- 添加 compact 函数的功能实现和语法优化 - 移除 UNSUPPORTED_FUNCTIONS 列表中的 compact 条目 - 在 Preprocessor 中添加防止重定义内置函数的检查 - 实现 genCompact 方法来处理 compact 函数调用 - 添加测试用例验证 compact 函数功能正确性 - 增强错误处理机制以捕获非法变量使用情况pull/1/head
parent
165d683f5a
commit
8865796b43
4 changed files with 54 additions and 1 deletions
@ -0,0 +1,22 @@ |
|||||||
|
--TEST-- |
||||||
|
compact |
||||||
|
--FILE-- |
||||||
|
<?php |
||||||
|
function main() |
||||||
|
{ |
||||||
|
$city = "San Francisco"; |
||||||
|
$state = "CA"; |
||||||
|
$event = "SIGGRAPH"; |
||||||
|
$result = compact("event", "city", "state"); |
||||||
|
var_dump($result); |
||||||
|
} |
||||||
|
?> |
||||||
|
--EXPECT-- |
||||||
|
array(3) { |
||||||
|
["event"]=> |
||||||
|
string(8) "SIGGRAPH" |
||||||
|
["city"]=> |
||||||
|
string(13) "San Francisco" |
||||||
|
["state"]=> |
||||||
|
string(2) "CA" |
||||||
|
} |
||||||
Loading…
Reference in new issue