Commit 40721797ba0 for php
commit 40721797ba0aba2b596256f94dc1c529400aea0e
Author: Gina Peter Banyard <girgias@php.net>
Date: Sat Sep 19 18:25:36 2026 +0100
Zend: move type tests to common folder and add some more
diff --git a/Zend/tests/typehints/bug62441.phpt b/Zend/tests/type_declarations/bug62441.phpt
similarity index 100%
rename from Zend/tests/typehints/bug62441.phpt
rename to Zend/tests/type_declarations/bug62441.phpt
diff --git a/Zend/tests/type_declarations/builtin/fully_qualified_array.phpt b/Zend/tests/type_declarations/builtin/fully_qualified_array.phpt
new file mode 100644
index 00000000000..c0ba1051b98
--- /dev/null
+++ b/Zend/tests/type_declarations/builtin/fully_qualified_array.phpt
@@ -0,0 +1,13 @@
+--TEST--
+Fully qualified (leading backslash) array type name must fail
+--FILE--
+<?php
+
+function foo(\array $foo) {
+ var_dump($foo);
+}
+foo(1);
+
+?>
+--EXPECTF--
+Fatal error: Cannot use "array" as a type name as it is reserved in %s on line %d
diff --git a/Zend/tests/typehints/fully_qualified_scalar.phpt b/Zend/tests/type_declarations/builtin/fully_qualified_scalar.phpt
similarity index 100%
rename from Zend/tests/typehints/fully_qualified_scalar.phpt
rename to Zend/tests/type_declarations/builtin/fully_qualified_scalar.phpt
diff --git a/Zend/tests/type_declarations/builtin/namespace_relative_array.phpt b/Zend/tests/type_declarations/builtin/namespace_relative_array.phpt
new file mode 100644
index 00000000000..2480620074f
--- /dev/null
+++ b/Zend/tests/type_declarations/builtin/namespace_relative_array.phpt
@@ -0,0 +1,11 @@
+--TEST--
+namespace\array is not a valid type declaration
+--FILE--
+<?php
+
+function test(namespace\array $i) {}
+test(0);
+
+?>
+--EXPECTF--
+Fatal error: Cannot use "array" as a type name as it is reserved in %s on line %d
diff --git a/Zend/tests/typehints/namespace_relative_scalar.phpt b/Zend/tests/type_declarations/builtin/namespace_relative_scalar.phpt
similarity index 77%
rename from Zend/tests/typehints/namespace_relative_scalar.phpt
rename to Zend/tests/type_declarations/builtin/namespace_relative_scalar.phpt
index 096d0473871..12ff9939a4e 100644
--- a/Zend/tests/typehints/namespace_relative_scalar.phpt
+++ b/Zend/tests/type_declarations/builtin/namespace_relative_scalar.phpt
@@ -1,5 +1,5 @@
--TEST--
-namespace\int is not a valid type hint
+namespace\int is not a valid type declaration
--FILE--
<?php
diff --git a/Zend/tests/type_declarations/callable/fully_qualified_callable.phpt b/Zend/tests/type_declarations/callable/fully_qualified_callable.phpt
new file mode 100644
index 00000000000..405125b207a
--- /dev/null
+++ b/Zend/tests/type_declarations/callable/fully_qualified_callable.phpt
@@ -0,0 +1,10 @@
+--TEST--
+Fully qualified (leading backslash) callable type names must fail
+--FILE--
+<?php
+
+function test($i): \callable {}
+
+?>
+--EXPECTF--
+Fatal error: Cannot use "callable" as a type name as it is reserved in %s on line %d
diff --git a/Zend/tests/type_declarations/callable/namespace_relative_callable.phpt b/Zend/tests/type_declarations/callable/namespace_relative_callable.phpt
new file mode 100644
index 00000000000..ccf67a0adc8
--- /dev/null
+++ b/Zend/tests/type_declarations/callable/namespace_relative_callable.phpt
@@ -0,0 +1,10 @@
+--TEST--
+namespace\callable is not a valid type declaration
+--FILE--
+<?php
+
+function test($i): namespace\callable {}
+
+?>
+--EXPECTF--
+Fatal error: Cannot use "callable" as a type name as it is reserved in %s on line %d
diff --git a/Zend/tests/typehints/fq_nullable.phpt b/Zend/tests/type_declarations/fq_nullable.phpt
similarity index 100%
rename from Zend/tests/typehints/fq_nullable.phpt
rename to Zend/tests/type_declarations/fq_nullable.phpt
diff --git a/Zend/tests/typehints/or_null.phpt b/Zend/tests/type_declarations/or_null.phpt
similarity index 100%
rename from Zend/tests/typehints/or_null.phpt
rename to Zend/tests/type_declarations/or_null.phpt