From 25aeff51a7f13ddd77cfb5bd893c320a7923d424 Mon Sep 17 00:00:00 2001 From: tianfenghan Date: Sat, 20 Jun 2026 22:13:28 +0800 Subject: [PATCH] =?UTF-8?q?refactor(generator):=20=E7=AE=80=E5=8C=96?= =?UTF-8?q?=E7=B1=BB=E5=AF=B9=E8=B1=A1=E5=A4=84=E7=90=86=E5=99=A8=E5=88=9D?= =?UTF-8?q?=E5=A7=8B=E5=8C=96=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 移除手动初始化 zend_object_handlers 的冗余代码 - 直接使用预定义的 php_aot_object_handlers 全局变量 - 减少代码行数并提高可读性 - 保持相同的功能实现 --- src/gen_stub.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/gen_stub.php b/src/gen_stub.php index d6c1c4c7..0bcb992a 100755 --- a/src/gen_stub.php +++ b/src/gen_stub.php @@ -3781,10 +3781,7 @@ class ClassInfo { $code .= $php80CondEnd; } - $code .= "\n\tstatic zend_object_handlers class_object_handlers;"; - $code .= "\n\tphp_aot_init_object_handlers(&class_object_handlers);"; - $code .= "\n\tclass_entry->default_object_handlers = &class_object_handlers;"; - $code .= "\n"; + $code .= "\n\tclass_entry->default_object_handlers = &php_aot_object_handlers;\n"; $code .= "\n\treturn class_entry;\n";