bug25547.phpt 410 B

123456789101112131415161718192021222324252627282930
  1. --TEST--
  2. Bug #25547 (error_handler and array index with function call)
  3. --FILE--
  4. <?php
  5. function handler($errno, $errstr, $errfile, $errline)
  6. {
  7. echo __FUNCTION__ . "($errstr)\n";
  8. }
  9. set_error_handler('handler');
  10. function foo($x) {
  11. return "foo";
  12. }
  13. $output = array();
  14. ++$output[foo("bar")];
  15. print_r($output);
  16. echo "Done";
  17. ?>
  18. --EXPECT--
  19. handler(Undefined array key "foo")
  20. Array
  21. (
  22. [foo] => 1
  23. )
  24. Done