php-src/ext/ffi/tests/weak_reference_001.phpt

18 lines
261 B
PHP

--TEST--
Weak reference to \FFI
--EXTENSIONS--
ffi
--INI--
ffi.enable=1
--FILE--
<?php
$ffi = \FFI::cdef('');
$ref = \WeakReference::create($ffi);
var_dump($ref->get() === $ffi);
unset($ffi);
var_dump($ref->get() === null);
?>
--EXPECTF--
bool(true)
bool(true)