mirror of
https://github.com/php/php-src.git
synced 2024-12-03 23:05:57 +08:00
1b565f1393
Implements RFC "Deprecate and Remove Bareword (Unquoted) Strings" [https://wiki.php.net/rfc/deprecate-bareword-strings]
33 lines
906 B
PHP
33 lines
906 B
PHP
--TEST--
|
|
Bug #43344.1 (Wrong error message for undefined namespace constant)
|
|
--FILE--
|
|
<?php
|
|
namespace Foo;
|
|
function f1($a=bar) {
|
|
return $a;
|
|
}
|
|
function f2($a=array(bar)) {
|
|
return $a[0];
|
|
}
|
|
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
|
|
|
|
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
|