Annotation of embedaddon/php/ext/reflection/tests/bug62384.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Bug #62384 (Attempting to invoke a Closure more than once causes segfaul)
! 3: --FILE--
! 4: <?php
! 5:
! 6: $closure1 = function($val){ return $val; };
! 7: $closure2 = function($val){ return $val; };
! 8:
! 9: $reflection_class = new ReflectionClass($closure1);
! 10: $reflection_method = $reflection_class->getMethod('__invoke');
! 11:
! 12: $arguments1 = array('hello');
! 13: $arguments2 = array('world');
! 14:
! 15: var_dump($reflection_method->invokeArgs($closure1, $arguments1));
! 16: var_dump($reflection_method->invokeArgs($closure2, $arguments2));
! 17:
! 18: ?>
! 19: --EXPECT--
! 20: string(5) "hello"
! 21: string(5) "world"
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>