- 新增 tests/aot/class/new-and-call.phpt 测试文件,验证 new 和 call 操作 - 添加 samples/script.php 示例文件,演示 PHP_OS 函数使用 - 实现了类实例化后直接调用方法的测试场景 - 创建pull/5/head
parent
95e9b6fef4
commit
918a52d7fb
2 changed files with 25 additions and 0 deletions
@ -0,0 +1,5 @@ |
|||||||
|
<?php |
||||||
|
function php_os() |
||||||
|
{ |
||||||
|
var_dump(PHP_OS); |
||||||
|
} |
||||||
@ -0,0 +1,20 @@ |
|||||||
|
--TEST-- |
||||||
|
new and call |
||||||
|
--FILE-- |
||||||
|
<?php |
||||||
|
class FooTestNewAndCall { |
||||||
|
public function bar(string $name) |
||||||
|
{ |
||||||
|
var_dump('hello ' . $name . '!'); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
function main() { |
||||||
|
(new FooTestNewAndCall())->bar('world'); |
||||||
|
echo "done\n"; |
||||||
|
} |
||||||
|
|
||||||
|
?> |
||||||
|
--EXPECT-- |
||||||
|
string(12) "hello world!" |
||||||
|
done |
||||||
Loading…
Reference in new issue