bug46106.phpt 447 B

123456789101112131415161718192021222324252627
  1. --TEST--
  2. Bug #46106 (Memory leaks when using global statement)
  3. --FILE--
  4. <?php
  5. $foo = array(1);
  6. function foobar($errno, $errstr, $errfile, $errline) { }
  7. set_error_handler('foobar');
  8. function test($x) {
  9. global $foo;
  10. $x->invokeArgs(array(0));
  11. }
  12. $x = new ReflectionFunction('str_pad');
  13. try {
  14. test($x);
  15. } catch (TypeError $e) {
  16. echo $e->getMessage(), "\n";
  17. }
  18. ?>
  19. DONE
  20. --EXPECT--
  21. str_pad() expects at least 2 arguments, 1 given
  22. DONE