2017-05-16 18:17:12 +02:00
|
|
|
--TEST--
|
|
|
|
Test order of destruction not interfering with access to UV handles
|
|
|
|
--SKIPIF--
|
|
|
|
<?php
|
2017-11-29 13:36:50 +01:00
|
|
|
\extension_loaded("uv") or die("SKIP: ext/uv required for this test");
|
2017-05-16 18:17:12 +02:00
|
|
|
?>
|
|
|
|
--FILE--
|
|
|
|
<?php
|
|
|
|
|
|
|
|
include __DIR__.'/../../vendor/autoload.php';
|
|
|
|
|
|
|
|
use Amp\Loop;
|
|
|
|
|
2017-05-16 20:08:27 +02:00
|
|
|
Loop::run(function () {
|
|
|
|
Loop::setState('test', new class {
|
|
|
|
private $handle;
|
|
|
|
public function __construct() {
|
|
|
|
$this->handle = Loop::repeat(10, function () {});
|
|
|
|
}
|
|
|
|
public function __destruct() {
|
|
|
|
Loop::cancel($this->handle);
|
|
|
|
print "ok";
|
|
|
|
}
|
|
|
|
});
|
|
|
|
Loop::delay(0, [Loop::class, "stop"]);
|
2017-05-16 18:17:12 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
?>
|
|
|
|
--EXPECT--
|
|
|
|
ok
|