bug43344_1.phpt 735 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. --TEST--
  2. Bug #43344.1 (Wrong error message for undefined namespace constant)
  3. --FILE--
  4. <?php
  5. namespace Foo;
  6. use Error;
  7. function f1($a=bar) {
  8. return $a;
  9. }
  10. function f2($a=array(bar)) {
  11. return $a[0];
  12. }
  13. function f3($a=array(bar=>0)) {
  14. reset($a);
  15. return key($a);
  16. }
  17. try {
  18. echo bar."\n";
  19. } catch (Error $e) {
  20. echo $e->getMessage(), "\n";
  21. }
  22. try {
  23. echo f1()."\n";
  24. } catch (Error $e) {
  25. echo $e->getMessage(), "\n";
  26. }
  27. try {
  28. echo f2()."\n";
  29. } catch (Error $e) {
  30. echo $e->getMessage(), "\n";
  31. }
  32. try {
  33. echo f3()."\n";
  34. } catch (Error $e) {
  35. echo $e->getMessage(), "\n";
  36. }
  37. ?>
  38. --EXPECT--
  39. Undefined constant "Foo\bar"
  40. Undefined constant "Foo\bar"
  41. Undefined constant "Foo\bar"
  42. Undefined constant "Foo\bar"