com php-src: Add test to ensure namespaced code can't use scalar types as class names: Zend/tests/typehints/scalar_reserved7.phpt
| From: | Dmitry Stogov | Date: | Thu, 19 Mar 2015 18:11:48 +0000 |
| Subject: | com php-src: Add test to ensure namespaced code can't use scalar types as class names: Zend/tests/typehints/scalar_reserved7.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-85691@lists.php.net to get a copy of this message | ||
Commit: c11cab32558e5c006dbf93ec2d388f0ff0d7eb17
Author: Anthony Ferrara <ircmaxell@gmail.com> Thu, 19 Mar 2015 14:11:48 -0400
Parents: aaf0c8b594f1ddcd090123fff3734b0aa1eeccd9
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=c11cab32558e5c006dbf93ec2d388f0ff0d7eb17
Log:
Add test to ensure namespaced code can't use scalar types as class names
Changed paths:
A Zend/tests/typehints/scalar_reserved7.phpt
Diff:
diff --git a/Zend/tests/typehints/scalar_reserved7.phpt b/Zend/tests/typehints/scalar_reserved7.phpt
new file mode 100644
index 0000000..330235d
--- /dev/null
+++ b/Zend/tests/typehints/scalar_reserved7.phpt
@@ -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