com php-src: Remove the aliases of scalar types: Zend/tests/typ ehints/scalar_aliases.phpt Zend/tests/typehints/scalar_ reserved1.phpt
Zend/tests/typehints/scalar_reserved1 _class_alias.phpt Zend/tests/typehints/scalar_reserve d1_use.phpt Zend/tests/typehints/scalar_reserved5 .phpt
Zend/tests/typehints/scalar_reserved5_class_a lias.phpt Zend/tests/typehints/scalar_reserved5_use .phpt Zend/zend_compile.c
| From: | Dmitry Stogov | Date: | Wed, 18 Feb 2015 21:43:39 +0000 |
| Subject: | com php-src: Remove the aliases of scalar types: Zend/tests/typ ehints/scalar_aliases.phpt Zend/tests/typehints/scalar_ reserved1.phpt Zend/tests/typehints/scalar_reserved1 _class_alias.phpt Zend/tests/typehints/scalar_reserve d1_use.phpt Zend/tests/typehints/scalar_reserved5 .phpt Zend/tests/typehints/scalar_reserved5_class_a lias.phpt Zend/tests/typehints/scalar_reserved5_use .phpt Zend/zend_compile.c |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-85694@lists.php.net to get a copy of this message | ||
Commit: c8590799622ddb801360664d08ac5d7f4fa342df
Author: Anthony Ferrara <ircmaxell@gmail.com> Wed, 18 Feb 2015 16:43:39 -0500
Parents: c6996a2988a6a59772efaff29b91175b04aae965
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=c8590799622ddb801360664d08ac5d7f4fa342df
Log:
Remove the aliases of scalar types
Changed paths:
D Zend/tests/typehints/scalar_aliases.phpt
D Zend/tests/typehints/scalar_reserved1.phpt
D Zend/tests/typehints/scalar_reserved1_class_alias.phpt
D Zend/tests/typehints/scalar_reserved1_use.phpt
D Zend/tests/typehints/scalar_reserved5.phpt
D Zend/tests/typehints/scalar_reserved5_class_alias.phpt
D Zend/tests/typehints/scalar_reserved5_use.phpt
M Zend/zend_compile.c
Diff:
diff --git a/Zend/tests/typehints/scalar_aliases.phpt b/Zend/tests/typehints/scalar_aliases.phpt
deleted file mode 100644
index 500e5da..0000000
--- a/Zend/tests/typehints/scalar_aliases.phpt
+++ /dev/null
@@ -1,20 +0,0 @@
---TEST--
-Scalar type hint aliases
---FILE--
-<?php
-
-function foo(integer $a, boolean $b) {
- var_dump($a, $b);
-}
-
-function bar(int $a, bool $b) {
- var_dump($a, $b);
-}
-
-foo(1, true);
-bar(1, true);
---EXPECT--
-int(1)
-bool(true)
-int(1)
-bool(true)
diff --git a/Zend/tests/typehints/scalar_reserved1.phpt b/Zend/tests/typehints/scalar_reserved1.phpt
deleted file mode 100644
index 00a7482..0000000
--- a/Zend/tests/typehints/scalar_reserved1.phpt
+++ /dev/null
@@ -1,8 +0,0 @@
---TEST--
-Scalar type hint names cannot be used as class, trait or interface names (1)
---FILE--
-<?php
-
-class integer {}
---EXPECTF--
-Fatal error: "integer" cannot be used as a class name in %s on line %d
diff --git a/Zend/tests/typehints/scalar_reserved1_class_alias.phpt
b/Zend/tests/typehints/scalar_reserved1_class_alias.phpt
deleted file mode 100644
index 59b1573..0000000
--- a/Zend/tests/typehints/scalar_reserved1_class_alias.phpt
+++ /dev/null
@@ -1,9 +0,0 @@
---TEST--
-Scalar type hint names cannot be used as class, trait or interface names (1) - class_alias
---FILE--
-<?php
-
-class foobar {}
-class_alias("foobar", "integer");
---EXPECTF--
-Fatal error: "integer" cannot be used as a class name in %s on line %d
diff --git a/Zend/tests/typehints/scalar_reserved1_use.phpt
b/Zend/tests/typehints/scalar_reserved1_use.phpt
deleted file mode 100644
index 3945890..0000000
--- a/Zend/tests/typehints/scalar_reserved1_use.phpt
+++ /dev/null
@@ -1,8 +0,0 @@
---TEST--
-Scalar type hint names cannot be used as class, trait or interface names (1) - use
---FILE--
-<?php
-
-use foobar as integer;
---EXPECTF--
-Fatal error: "integer" cannot be used as a class name in %s on line %d
diff --git a/Zend/tests/typehints/scalar_reserved5.phpt b/Zend/tests/typehints/scalar_reserved5.phpt
deleted file mode 100644
index c23dac6..0000000
--- a/Zend/tests/typehints/scalar_reserved5.phpt
+++ /dev/null
@@ -1,8 +0,0 @@
---TEST--
-Scalar type hint names cannot be used as class, trait or interface names (5)
---FILE--
-<?php
-
-class boolean {}
---EXPECTF--
-Fatal error: "boolean" cannot be used as a class name in %s on line %d
diff --git a/Zend/tests/typehints/scalar_reserved5_class_alias.phpt
b/Zend/tests/typehints/scalar_reserved5_class_alias.phpt
deleted file mode 100644
index b2c89ac..0000000
--- a/Zend/tests/typehints/scalar_reserved5_class_alias.phpt
+++ /dev/null
@@ -1,9 +0,0 @@
---TEST--
-Scalar type hint names cannot be used as class, trait or interface names (5) - class_alias
---FILE--
-<?php
-
-class foobar {}
-class_alias("foobar", "boolean");
---EXPECTF--
-Fatal error: "boolean" cannot be used as a class name in %s on line %d
diff --git a/Zend/tests/typehints/scalar_reserved5_use.phpt
b/Zend/tests/typehints/scalar_reserved5_use.phpt
deleted file mode 100644
index a277b91..0000000
--- a/Zend/tests/typehints/scalar_reserved5_use.phpt
+++ /dev/null
@@ -1,8 +0,0 @@
---TEST--
-Scalar type hint names cannot be used as class, trait or interface names (5) - use
---FILE--
-<?php
-
-use foobar as boolean;
---EXPECTF--
-Fatal error: "boolean" cannot be used as a class name in %s on line %d
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index 263af0a..ad4a9ed 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -147,11 +147,9 @@ struct _scalar_typehint_info {
static const struct _scalar_typehint_info scalar_typehints[] = {
{"int", sizeof("int") - 1, IS_LONG},
- {"integer", sizeof("integer") - 1, IS_LONG},
{"float", sizeof("float") - 1, IS_DOUBLE},
{"string", sizeof("string") - 1, IS_STRING},
{"bool", sizeof("bool") - 1, _IS_BOOL},
- {"boolean", sizeof("boolean") - 1, _IS_BOOL},
{NULL, 0, IS_UNDEF}
};