com php-langspec: (unset) casts are no longer supported since PHP 8: spec/10-expressions.md tests/expressions/unary_operators/cast .phpt
| From: | Nikita Popov | Date: | Mon, 08 Apr 2019 07:02:56 +0000 |
| Subject: | com php-langspec: (unset) casts are no longer supported since PHP 8: spec/10-expressions.md tests/expressions/unary_operators/cast .phpt | ||
| Groups: | php.standards.cvs | ||
| Request: | Send a blank email to standards--cvs+get-435@lists.php.net to get a copy of this message | ||
Commit: 5fc96c5dfd962ef25a362fc6108acae39cf9f1fd
Author: Nikita Popov <nikita.ppv@gmail.com> Mon, 8 Apr 2019 09:02:56 +0200
Parents: dc2e8d9593bd6b5826d10afcfbb86140733d4b13
Branches: master
Link: http://git.php.net/?p=php-langspec.git;a=commitdiff;h=5fc96c5dfd962ef25a362fc6108acae39cf9f1fd
Log:
(unset) casts are no longer supported since PHP 8
Changed paths:
M spec/10-expressions.md
M tests/expressions/unary_operators/cast.phpt
Diff:
diff --git a/spec/10-expressions.md b/spec/10-expressions.md
index 689fec7..93c8112 100644
--- a/spec/10-expressions.md
+++ b/spec/10-expressions.md
@@ -1888,6 +1888,10 @@ cast-type: one of
real string unset
</pre>
+**Constaints**
+
+A *cast-type* of
unset is no longer supported and results in a compile-time error.
+
**Semantics**
With the exception of the *cast-type* unset and binary (see below), the
@@ -1914,9 +1918,6 @@ A *cast-type* of object results in a [conversion to type
object](08-conversi
A *cast-type* of string results in a [conversion to type
string](08-conversions.md#converting-to-string-type).
-A *cast-type* of unset always results in a value of NULL. (This use of
-unset should not be confused with the [unset
statement](11-statements.md#the-unset-statement).
-
**Examples**
```PHP
diff --git a/tests/expressions/unary_operators/cast.phpt
b/tests/expressions/unary_operators/cast.phpt
index 6e48753..9c71438 100644
--- a/tests/expressions/unary_operators/cast.phpt
+++ b/tests/expressions/unary_operators/cast.phpt
@@ -29,8 +29,10 @@ echo var_dump((binary)"");
echo var_dump((binary)"abcdef");
echo var_dump($v);
-echo var_dump((unset)$v);
-echo var_dump($v);
+
+// The (unset) cast is no longer supported
+//echo var_dump((unset)$v);
+//echo var_dump($v);
//*/
///*
@@ -146,7 +148,6 @@ var_dump($binStr);
$binStr = b"AaBb123$%^";
var_dump($binStr);
--EXPECTF--
-Deprecated: The (unset) cast is deprecated in %s on line %d
bool(false)
bool(false)
int(0)
@@ -167,8 +168,6 @@ string(1) "0"
string(0) ""
string(6) "abcdef"
int(0)
-NULL
-int(0)
int(10)
bool(true)
bool(true)
@@ -456,7 +455,7 @@ array(2) {
int(1)
float(1)
-Notice: Array to string conversion in %s/expressions/unary_operators/cast.php on line 50
+Notice: Array to string conversion in %s/expressions/unary_operators/cast.php on line %d
string(5) "Array"
array(2) {
[5]=>
@@ -485,7 +484,7 @@ array(4) {
int(1)
float(1)
-Notice: Array to string conversion in %s/expressions/unary_operators/cast.php on line 50
+Notice: Array to string conversion in %s/expressions/unary_operators/cast.php on line %d
string(5) "Array"
array(4) {
[0]=>
@@ -555,7 +554,7 @@ object(E)#3 (3) {
$key: >