From 60298d94618c6355ed821857d5d3371c569db4fe Mon Sep 17 00:00:00 2001 From: tianfenghan Date: Wed, 8 Apr 2026 15:01:14 +0800 Subject: [PATCH] =?UTF-8?q?test(lang):=20=E6=B7=BB=E5=8A=A0=E5=A4=9A?= =?UTF-8?q?=E4=B8=AA=E8=AF=AD=E8=A8=80=E7=89=B9=E6=80=A7=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E7=9A=84=E5=9B=9E=E5=BD=92=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 添加 bug27443 测试:验证 defined() 函数返回正确的布尔类型 - 添加 bug27535 测试:验证循环引用对象不会导致崩溃问题 - 添加 bug29944 测试:验证 switch 语句中定义函数的功能正常 - 添加 bug30578 测试:验证析构函数调用时机与输出缓冲区处理 --- tests/core/lang/bug27443.phpt | 8 ++++++++ tests/core/lang/bug27535.phpt | 27 +++++++++++++++++++++++++++ tests/core/lang/bug29944.phpt | 20 ++++++++++++++++++++ tests/core/lang/bug30578.phpt | 31 +++++++++++++++++++++++++++++++ 4 files changed, 86 insertions(+) create mode 100644 tests/core/lang/bug27443.phpt create mode 100644 tests/core/lang/bug27535.phpt create mode 100644 tests/core/lang/bug29944.phpt create mode 100644 tests/core/lang/bug30578.phpt diff --git a/tests/core/lang/bug27443.phpt b/tests/core/lang/bug27443.phpt new file mode 100644 index 00000000..40979433 --- /dev/null +++ b/tests/core/lang/bug27443.phpt @@ -0,0 +1,8 @@ +--TEST-- +Bug #27443 (defined() returns wrong type) +--FILE-- + +--EXPECT-- +boolean diff --git a/tests/core/lang/bug27535.phpt b/tests/core/lang/bug27535.phpt new file mode 100644 index 00000000..96bd4db2 --- /dev/null +++ b/tests/core/lang/bug27535.phpt @@ -0,0 +1,27 @@ +--TEST-- +Bug #27535 (Objects pointing to each other cause Apache to crash) +--FILE-- +storage = new Class1(); + + $this->storage->_Class2_obj = $this; + } +} + +function main() { + $foo = new Class2(); +} +?> +--EXPECT-- diff --git a/tests/core/lang/bug29944.phpt b/tests/core/lang/bug29944.phpt new file mode 100644 index 00000000..8d8220ef --- /dev/null +++ b/tests/core/lang/bug29944.phpt @@ -0,0 +1,20 @@ +--TEST-- +Bug #29944 (function defined in switch crashes PHP) +--FILE-- + +--EXPECT-- +1 diff --git a/tests/core/lang/bug30578.phpt b/tests/core/lang/bug30578.phpt new file mode 100644 index 00000000..1d859340 --- /dev/null +++ b/tests/core/lang/bug30578.phpt @@ -0,0 +1,31 @@ +--TEST-- +Bug #30578 (Output buffers flushed before calling __destruct functions) +--FILE-- + +--EXPECT-- +This should be displayed first. +Buffered data: This should be displayed last.