bug62384.phpt 571 B

123456789101112131415161718192021
  1. --TEST--
  2. Bug #62384 (Attempting to invoke a Closure more than once causes segfaul)
  3. --FILE--
  4. <?php
  5. $closure1 = function($val){ return $val; };
  6. $closure2 = function($val){ return $val; };
  7. $reflection_class = new ReflectionClass($closure1);
  8. $reflection_method = $reflection_class->getMethod('__invoke');
  9. $arguments1 = array('hello');
  10. $arguments2 = array('world');
  11. var_dump($reflection_method->invokeArgs($closure1, $arguments1));
  12. var_dump($reflection_method->invokeArgs($closure2, $arguments2));
  13. ?>
  14. --EXPECT--
  15. string(5) "hello"
  16. string(5) "world"