- 添加了新的测试用例验证 Bug #23384 的修复 - 实现了 genLambdaCall 方法用于处理静态变量赋值 - 修改 parseBeforeStmtLines 和 parseAfterStmtLines 方法以支持后置语句处理 - 在静态变量初始化时使用 lambda 表达式确保常量正确解析 - 修复了静态变量默认值解析中对类常量的引用问题pull/1/head
parent
e1fd716e03
commit
f226382d52
3 changed files with 66 additions and 2 deletions
@ -0,0 +1,33 @@ |
||||
--TEST-- |
||||
Bug #23384 (use of class constants in statics) |
||||
--FILE-- |
||||
<?php |
||||
|
||||
class Foo { |
||||
const HUN = 100; |
||||
static function test($x = Foo::HUN) { |
||||
static $arr2 = array(TEN => 'ten'); |
||||
static $arr = array(Foo::HUN => 'ten'); |
||||
|
||||
print_r($arr); |
||||
print_r($arr2); |
||||
print_r($x); |
||||
} |
||||
} |
||||
|
||||
function main() { |
||||
define('TEN', 10); |
||||
Foo::test(); |
||||
echo Foo::HUN . "\n"; |
||||
} |
||||
?> |
||||
--EXPECT-- |
||||
Array |
||||
( |
||||
[100] => ten |
||||
) |
||||
Array |
||||
( |
||||
[10] => ten |
||||
) |
||||
100100 |
||||
Loading…
Reference in new issue