TypePHP 编译器
https://swoole.com/aot/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
542 B
37 lines
542 B
--TEST--
|
|
return assign array dim
|
|
--SKIPIF--
|
|
--FILE--
|
|
<?php
|
|
|
|
class TestReturnAssignSetProp
|
|
{
|
|
protected ?array $array = null;
|
|
|
|
protected function makeArray(): array {
|
|
return [1, 3, 4];
|
|
}
|
|
public function test()
|
|
{
|
|
if ($this->array !== null) {
|
|
return $this->array;
|
|
}
|
|
return $this->array = $this->makeArray();
|
|
}
|
|
}
|
|
|
|
function main()
|
|
{
|
|
$obj = new TestReturnAssignSetProp;
|
|
var_dump($obj->test());
|
|
}
|
|
?>
|
|
--EXPECT--
|
|
array(3) {
|
|
[0]=>
|
|
int(1)
|
|
[1]=>
|
|
int(3)
|
|
[2]=>
|
|
int(4)
|
|
}
|