mirror of
https://github.com/php/php-src.git
synced 2026-04-19 05:51:02 +02:00
Remove most of the `===DONE===` tags and its variations. Keep `===DONE===` if the test output otherwise becomes empty. Closes GH-4872.
42 lines
650 B
PHP
42 lines
650 B
PHP
--TEST--
|
|
Reflection on closures: Segfault with getClosure() on closure itself
|
|
--FILE--
|
|
<?php
|
|
$closure = function() { echo "Invoked!\n"; };
|
|
|
|
$method = new ReflectionFunction ($closure);
|
|
|
|
$closure2 = $method->getClosure ();
|
|
|
|
$closure2 ();
|
|
$closure2->__invoke ();
|
|
|
|
unset ($closure);
|
|
|
|
$closure2 ();
|
|
$closure2->__invoke ();
|
|
|
|
$closure = function() { echo "Invoked!\n"; };
|
|
|
|
$method = new ReflectionMethod ($closure, '__invoke');
|
|
$closure2 = $method->getClosure ($closure);
|
|
|
|
$closure2 ();
|
|
$closure2->__invoke ();
|
|
|
|
unset ($closure);
|
|
|
|
$closure2 ();
|
|
$closure2->__invoke ();
|
|
|
|
?>
|
|
--EXPECT--
|
|
Invoked!
|
|
Invoked!
|
|
Invoked!
|
|
Invoked!
|
|
Invoked!
|
|
Invoked!
|
|
Invoked!
|
|
Invoked!
|