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.
52 lines
846 B
52 lines
846 B
--TEST--
|
|
default array property
|
|
--FILE--
|
|
<?php
|
|
|
|
namespace App{
|
|
class Test {
|
|
public const string TYPE_BOOL = 'php::Bool';
|
|
public const string TYPE_INT = 'php::Int';
|
|
public const string TYPE_FLOAT = 'php::Float';
|
|
|
|
protected array $array1 = [
|
|
'int' => self::TYPE_INT,
|
|
'float' => self::TYPE_FLOAT,
|
|
'bool' => self::TYPE_BOOL,
|
|
];
|
|
|
|
protected $array2;
|
|
|
|
function __construct() {
|
|
$this->array2 = ['php', 'java',];
|
|
}
|
|
|
|
function bar() {
|
|
var_dump($this->array1);
|
|
var_dump($this->array2);
|
|
}
|
|
}
|
|
}
|
|
|
|
namespace {
|
|
function main() {
|
|
$obj = new App\Test;
|
|
$obj->bar();
|
|
}
|
|
}
|
|
?>
|
|
--EXPECT--
|
|
array(3) {
|
|
["int"]=>
|
|
string(8) "php::Int"
|
|
["float"]=>
|
|
string(10) "php::Float"
|
|
["bool"]=>
|
|
string(9) "php::Bool"
|
|
}
|
|
array(2) {
|
|
[0]=>
|
|
string(3) "php"
|
|
[1]=>
|
|
string(4) "java"
|
|
}
|