- 在Symbol类中添加argList方法返回'php::ArgList' - 修改CompilerBase中参数列表的返回值格式 - 添加count-array.php示例文件展示数组计数功能pull/1/head
parent
c4c46bf3f0
commit
81957f56d7
3 changed files with 36 additions and 1 deletions
@ -0,0 +1,30 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
class FooArray |
||||||
|
{ |
||||||
|
public array $array; |
||||||
|
|
||||||
|
public function __construct(array $array) |
||||||
|
{ |
||||||
|
$this->array = $array; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
class Bar |
||||||
|
{ |
||||||
|
public function run(array $array) |
||||||
|
{ |
||||||
|
$n = count($array); |
||||||
|
var_dump($n); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
function main() |
||||||
|
{ |
||||||
|
$bar = new Bar(); |
||||||
|
|
||||||
|
$foo = new FooArray([1, 2, 3]); |
||||||
|
|
||||||
|
$bar->run($foo->array); |
||||||
|
|
||||||
|
} |
||||||
Loading…
Reference in new issue