From ad617bcac8fa7c0b1f22f7cb5cb8203c465e092d Mon Sep 17 00:00:00 2001 From: tianfenghan Date: Sat, 20 Jun 2026 23:55:01 +0800 Subject: [PATCH] =?UTF-8?q?test(aot):=20=E6=B7=BB=E5=8A=A0=E7=B1=BB?= =?UTF-8?q?=E7=BB=A7=E6=89=BF=E6=96=B9=E6=B3=95=E6=B5=8B=E8=AF=95=E7=94=A8?= =?UTF-8?q?=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 创建 BaseObject 基类并实现 foo 方法 - 创建 ChildObject 子类继承 BaseObject 并实现 bar 方法 - 添加 foo_test 函数验证基类参数传递和方法调用 - 实现 main 函数进行继承关系测试 - 验证 toObject 方法 --- tests/aot/class/base-class-method.phpt | 34 ++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 tests/aot/class/base-class-method.phpt diff --git a/tests/aot/class/base-class-method.phpt b/tests/aot/class/base-class-method.phpt new file mode 100644 index 00000000..539fe280 --- /dev/null +++ b/tests/aot/class/base-class-method.phpt @@ -0,0 +1,34 @@ +--TEST-- +class extends +--FILE-- +foo(); + $o->toObject(ChildObject::class)->bar(); +} + +function main() +{ + $o1 = new ChildObject; + foo_test($o1); +} +?> +--EXPECT-- +string(15) "BaseObject::foo" +string(16) "ChildObject::bar" \ No newline at end of file