com php-langspec: (unset) casts are no longer supported since PHP 8: spec/10-expressions.md tests/expressions/unary_operators/cast .phpt
[email protected] (Nikita Popov) Mon, 08 Apr 2019 07:02:56 +0000
| Newsgroups | php.standards.cvs |
|---|---|
| Message-ID | <[email protected]> |
Commit: 5fc96c5dfd962ef25a362fc6108acae39cf9f1fd=0AAuthor: Nikita Pop= ov <[email protected]> Mon, 8 Apr 2019 09:02:56 +0200=0AParents:= dc2e8d9593bd6b5826d10afcfbb86140733d4b13=0ABranches: master=0A=0ALink: = http://git.php.net/?p=3Dphp-langspec.git;a=3Dcommitdiff;h=3D5fc96c5df= d962ef25a362fc6108acae39cf9f1fd=0A=0ALog:=0A(unset) casts are no longer sup= ported since PHP 8=0A=0AChanged paths:=0A M spec/10-expressions.md=0A M = tests/expressions/unary_operators/cast.phpt=0A=0A=0ADiff:=0Adiff --git a/s= pec/10-expressions.md b/spec/10-expressions.md=0Aindex 689fec7..93c8112 100= 644=0A--- a/spec/10-expressions.md=0A+++ b/spec/10-expressions.md=0A@@ -188= 8,6 +1888,10 @@ cast-type: one of=0A real string unset=0A </pre>=0A = =0A+**Constaints**=0A+=0A+A *cast-type* of `unset` is no longer supported a= nd results in a compile-time error.=0A+=0A **Semantics**=0A =0A With the ex= ception of the *cast-type* unset and binary (see below), the=0A@@ -1914,9 += 1918,6 @@ A *cast-type* of `object` results in a [conversion to type `objec= t`](08-conversi=0A =0A A *cast-type* of `string` results in a [conversion t= o type `string`](08-conversions.md#converting-to-string-type).=0A =0A-A *ca= st-type* of `unset` always results in a value of `NULL`. (This use of=0A-`u= nset` should not be confused with the [`unset` statement](11-statements.md#= the-unset-statement).=0A-=0A **Examples**=0A =0A ```PHP=0Adiff --git a/test= s/expressions/unary_operators/cast.phpt b/tests/expressions/unary_operators= /cast.phpt=0Aindex 6e48753..9c71438 100644=0A--- a/tests/expressions/unary_= operators/cast.phpt=0A+++ b/tests/expressions/unary_operators/cast.phpt=0A@= @ -29,8 +29,10 @@ echo var_dump((binary)"");=0A echo var_dump((binary)"abcd= ef");=0A =0A echo var_dump($v);=0A-echo var_dump((unset)$v);=0A-echo var_du= mp($v);=0A+=0A+// The (unset) cast is no longer supported=0A+//echo var_dum= p((unset)$v);=0A+//echo var_dump($v);=0A //*/=0A =0A ///*=0A@@ -146,7 +148,= 6 @@ var_dump($binStr);=0A $binStr =3D b"AaBb123$%^";=0A var_dump($binStr);= =0A --EXPECTF--=0A-Deprecated: The (unset) cast is deprecated in %s on line= %d=0A bool(false)=0A bool(false)=0A int(0)=0A@@ -167,8 +168,6 @@ string(1)= "0"=0A string(0) ""=0A string(6) "abcdef"=0A int(0)=0A-NULL=0A-int(0)=0A i= nt(10)=0A bool(true)=0A bool(true)=0A@@ -456,7 +455,7 @@ array(2) {= =0A int(1)=0A float(1)=0A =0A-Notice: Array to string conversion i= n %s/expressions/unary_operators/cast.php on line 50=0A+Notice: Array to st= ring conversion in %s/expressions/unary_operators/cast.php on line %d=0A st= ring(5) "Array"=0A array(2) {=0A [5]=3D>=0A@@ -485,7 +484,7 @@ array(4= ) {=0A int(1)=0A float(1)=0A =0A-Notice: Array to string conversio= n in %s/expressions/unary_operators/cast.php on line 50=0A+Notice: Array to= string conversion in %s/expressions/unary_operators/cast.php on line %d=0A= string(5) "Array"=0A array(4) {=0A [0]=3D>=0A@@ -555,7 +554,7 @@ obje= ct(E)#3 (3) {=0A $key: >=00E=00priv_prop<, len: 12, $val: ><=0A $key: >=00*= =00prot_prop<, len: 12, $val: >12.345<=0A =0A-Notice: Array to string conve= rsion in %s/expressions/unary_operators/cast.php on line 115=0A+Notice: Arr= ay to string conversion in %s/expressions/unary_operators/cast.php on line = %d=0A $key: >publ_prop<, len: 9, $val: >Array<=0A ---------------=0A resour= ce(1) of type (stream)=0A