]> granicus.if.org Git - php/commitdiff
Add test to ensure namespaced code can't use scalar types as class names
authorAnthony Ferrara <ircmaxell@gmail.com>
Thu, 19 Mar 2015 18:11:48 +0000 (14:11 -0400)
committerAnthony Ferrara <ircmaxell@gmail.com>
Thu, 19 Mar 2015 18:11:48 +0000 (14:11 -0400)
Zend/tests/typehints/scalar_reserved7.phpt [new file with mode: 0644]

diff --git a/Zend/tests/typehints/scalar_reserved7.phpt b/Zend/tests/typehints/scalar_reserved7.phpt
new file mode 100644 (file)
index 0000000..330235d
--- /dev/null
@@ -0,0 +1,9 @@
+--TEST--
+Scalar type hint names cannot be used as class, trait or interface names (7)
+--FILE--
+<?php
+namespace foo;
+
+class int {}
+--EXPECTF--
+Fatal error: "int" cannot be used as a class name in %s on line %d