From 64e9d7677093fb2a81c7e457d1d01823c0555a15 Mon Sep 17 00:00:00 2001 From: tianfenghan Date: Tue, 2 Jun 2026 19:29:50 +0800 Subject: [PATCH] =?UTF-8?q?test(assign):=20=E6=B7=BB=E5=8A=A0=E4=B8=A5?= =?UTF-8?q?=E6=A0=BC=E7=B1=BB=E5=9E=8B=E5=A3=B0=E6=98=8E=E4=B8=BA0?= =?UTF-8?q?=E7=9A=84=E6=B5=8B=E8=AF=95=E7=94=A8=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增 testStrictTypesZeroNotAllowed 测试方法 - 验证 declare(strict_types=0) 不被允许的情况 - 添加对应的测试代码文件 declare-strict-types-zero.php - 确保只有 strict_types=1 被支持的功能测试 --- phpunit/code/declare-strict-types-zero.php | 2 ++ phpunit/src/AssignTest.php | 5 +++++ 2 files changed, 7 insertions(+) create mode 100644 phpunit/code/declare-strict-types-zero.php diff --git a/phpunit/code/declare-strict-types-zero.php b/phpunit/code/declare-strict-types-zero.php new file mode 100644 index 00000000..e3747999 --- /dev/null +++ b/phpunit/code/declare-strict-types-zero.php @@ -0,0 +1,2 @@ +exec("Cannot re-assign `\$x` from `php::Str` to `php::Array`", 're-assign-str-to-array.php'); } + + public function testStrictTypesZeroNotAllowed() + { + $this->exec("declare(strict_types=0) is not allowed, only strict_types=1 is supported", 'declare-strict-types-zero.php'); + } }