mirror of
https://github.com/php/php-src.git
synced 2024-11-24 10:24:11 +08:00
aba95c2399
This reverts commit 5ef138b0c7
.
32 lines
355 B
PHP
32 lines
355 B
PHP
--TEST--
|
|
class constants as default function arguments
|
|
--FILE--
|
|
<?php
|
|
|
|
class test {
|
|
const val = 1;
|
|
}
|
|
|
|
function foo($v = test::val) {
|
|
var_dump($v);
|
|
}
|
|
|
|
function bar($b = NoSuchClass::val) {
|
|
var_dump($b);
|
|
}
|
|
|
|
foo();
|
|
foo(5);
|
|
|
|
bar(10);
|
|
bar();
|
|
|
|
echo "Done\n";
|
|
?>
|
|
--EXPECTF--
|
|
int(1)
|
|
int(5)
|
|
int(10)
|
|
|
|
Fatal error: Class 'NoSuchClass' not found in %s on line %d
|