- 移除 CompilerBase.php 中不再使用的 method 属性初始化 - 为构造、析构、克隆方法添加无返回值类型限制 - 添加类和方法重置功能,确保状态正确清理 - 统一重复变量测试消息文本 - 调整静态绑定测试中的属性访问权限 - 新增受保护属性访问测试用例pull/1/head
parent
1341dec3f2
commit
485dce7b95
7 changed files with 46 additions and 5 deletions
@ -0,0 +1,12 @@ |
|||||||
|
<?php |
||||||
|
class Config { |
||||||
|
protected static array $settings = []; |
||||||
|
} |
||||||
|
|
||||||
|
class DevConfig extends Config { |
||||||
|
} |
||||||
|
|
||||||
|
function main() { |
||||||
|
// DevConfig 使用自己的 settings |
||||||
|
\DevConfig::$settings = ['dev' => true, 'debug' => true]; |
||||||
|
} |
||||||
@ -0,0 +1,18 @@ |
|||||||
|
--TEST-- |
||||||
|
Type Declarations - Strict and weak typing modes |
||||||
|
--FILE-- |
||||||
|
<?php |
||||||
|
function sum_iterable($numbers) { |
||||||
|
$sum = 0; |
||||||
|
foreach ($numbers as $num) { |
||||||
|
$sum += $num; |
||||||
|
} |
||||||
|
return $sum; |
||||||
|
} |
||||||
|
|
||||||
|
function main() { |
||||||
|
var_dump(sum_iterable([1, 2, 3, 4, 5])); |
||||||
|
} |
||||||
|
?> |
||||||
|
--EXPECT-- |
||||||
|
int(15) |
||||||
Loading…
Reference in new issue