summaryrefslogtreecommitdiff
path: root/Zend/tests/bug43344_1.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/tests/bug43344_1.phpt')
-rw-r--r--Zend/tests/bug43344_1.phpt43
1 files changed, 28 insertions, 15 deletions
diff --git a/Zend/tests/bug43344_1.phpt b/Zend/tests/bug43344_1.phpt
index 4635240699..28af70dc67 100644
--- a/Zend/tests/bug43344_1.phpt
+++ b/Zend/tests/bug43344_1.phpt
@@ -3,6 +3,8 @@ Bug #43344.1 (Wrong error message for undefined namespace constant)
--FILE--
<?php
namespace Foo;
+use Error;
+
function f1($a=bar) {
return $a;
}
@@ -13,20 +15,31 @@ function f3($a=array(bar=>0)) {
reset($a);
return key($a);
}
-echo bar."\n";
-echo f1()."\n";
-echo f2()."\n";
-echo f3()."\n";
-?>
---EXPECTF--
-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
-bar
-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
-bar
-
-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
-bar
+try {
+ echo bar."\n";
+} catch (Error $e) {
+ echo $e->getMessage(), "\n";
+}
+try {
+ echo f1()."\n";
+} catch (Error $e) {
+ echo $e->getMessage(), "\n";
+}
+try {
+ echo f2()."\n";
+} catch (Error $e) {
+ echo $e->getMessage(), "\n";
+}
+try {
+ echo f3()."\n";
+} catch (Error $e) {
+ echo $e->getMessage(), "\n";
+}
-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
-bar
+?>
+--EXPECT--
+Undefined constant 'Foo\bar'
+Undefined constant 'Foo\bar'
+Undefined constant 'Foo\bar'
+Undefined constant 'Foo\bar'