mirror of
https://github.com/php/php-src.git
synced 2024-12-24 17:30:48 +08:00
1836daf7f9
The "const" statement is still allowed outside of namespaces but arrays are disabled.
26 lines
294 B
PHP
26 lines
294 B
PHP
--TEST--
|
|
039: Constant declaration
|
|
--FILE--
|
|
<?php
|
|
function foo($a = A) {
|
|
echo "$a\n";
|
|
}
|
|
function bar($a = array(A => B)) {
|
|
foreach ($a as $key => $val) {
|
|
echo "$key\n";
|
|
echo "$val\n";
|
|
}
|
|
}
|
|
const A = "ok";
|
|
const B = A;
|
|
echo A . "\n";
|
|
echo B . "\n";
|
|
foo();
|
|
bar();
|
|
--EXPECT--
|
|
ok
|
|
ok
|
|
ok
|
|
ok
|
|
ok
|