- 将 swoole/phpx 从 ~2.1.3 更新到 ~2.1.5 - 添加动态调用方法测试用例 method-002.phpt - 新增命名参数调用功能的测试验证 - 添加对象动态方法调用的相关测试代码pull/1/head
parent
2c041ab8e1
commit
436e09f6ae
2 changed files with 33 additions and 1 deletions
@ -0,0 +1,32 @@ |
|||||||
|
--TEST-- |
||||||
|
named args |
||||||
|
--FILE-- |
||||||
|
<?php |
||||||
|
class FooObject |
||||||
|
{ |
||||||
|
public function bar($args) |
||||||
|
{ |
||||||
|
var_dump($args); |
||||||
|
} |
||||||
|
|
||||||
|
public function run() { |
||||||
|
$array['handler'] = 'bar'; |
||||||
|
$this->{$array['handler']}([2026, 'ae86', 'bmw']); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
function main() |
||||||
|
{ |
||||||
|
$object = new FooObject; |
||||||
|
$object->run(); |
||||||
|
} |
||||||
|
?> |
||||||
|
--EXPECT-- |
||||||
|
array(3) { |
||||||
|
[0]=> |
||||||
|
int(2026) |
||||||
|
[1]=> |
||||||
|
string(4) "ae86" |
||||||
|
[2]=> |
||||||
|
string(3) "bmw" |
||||||
|
} |
||||||
Loading…
Reference in new issue