bug43344_1.phpt 906 B

1234567891011121314151617181920212223242526272829303132
  1. --TEST--
  2. Bug #43344.1 (Wrong error message for undefined namespace constant)
  3. --FILE--
  4. <?php
  5. namespace Foo;
  6. function f1($a=bar) {
  7. return $a;
  8. }
  9. function f2($a=array(bar)) {
  10. return $a[0];
  11. }
  12. function f3($a=array(bar=>0)) {
  13. reset($a);
  14. return key($a);
  15. }
  16. echo bar."\n";
  17. echo f1()."\n";
  18. echo f2()."\n";
  19. echo f3()."\n";
  20. ?>
  21. --EXPECTF--
  22. Warning: Use of undefined constant bar - assumed 'bar' (this will throw an Error in a future version of PHP) in %sbug43344_1.php on line 13
  23. bar
  24. Warning: Use of undefined constant bar - assumed 'bar' (this will throw an Error in a future version of PHP) in %sbug43344_1.php on line 3
  25. bar
  26. Warning: Use of undefined constant bar - assumed 'bar' (this will throw an Error in a future version of PHP) in %sbug43344_1.php on line 6
  27. bar
  28. Warning: Use of undefined constant bar - assumed 'bar' (this will throw an Error in a future version of PHP) in %sbug43344_1.php on line 9
  29. bar