php-src/ext/reflection/tests/closures_004.phpt
2008-08-11 22:30:44 +00:00

28 lines
401 B
PHP

--TEST--
Reflection on closures: Segfault with getClosure() on closure itself
--FILE--
<?php
$closure = function() { echo "Invoked!\n"; };
$method = new ReflectionMethod ($closure);
$closure2 = $method->getClosure ($closure);
$closure2 ();
$closure2->__invoke ();
unset ($closure);
$closure2 ();
$closure2->__invoke ();
?>
===DONE===
--EXPECTF--
Invoked!
Invoked!
Invoked!
Invoked!
===DONE===