Annotation of embedaddon/php/ext/reflection/tests/closures_003_v1.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Reflection on closures: Segfaults with getParameters() and getDeclaringFunction()
! 3: --FILE--
! 4: <?php
! 5:
! 6: $closure = function($a, $b = 0) { };
! 7:
! 8: $method = new ReflectionFunction ($closure);
! 9: $params = $method->getParameters ();
! 10: unset ($method);
! 11: $method = $params[0]->getDeclaringFunction ();
! 12: unset ($params);
! 13: echo $method->getName ()."\n";
! 14:
! 15: $parameter = new ReflectionParameter ($closure, 'b');
! 16: $method = $parameter->getDeclaringFunction ();
! 17: unset ($parameter);
! 18: echo $method->getName ()."\n";
! 19:
! 20: ?>
! 21: ===DONE===
! 22: --EXPECTF--
! 23: {closure}
! 24: {closure}
! 25: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>