Skip to content

Commit d74d392

Browse files
committed
Remove (unset) cast
Deprecated in PHP 7.2 as part of https://wiki.php.net/rfc/deprecations_php_7_2.
1 parent c97b9aa commit d74d392

File tree

4 files changed

+14
-15
lines changed

4 files changed

+14
-15
lines changed

UPGRADING

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ PHP 8.0 UPGRADE NOTES
2121
========================================
2222

2323
- Core:
24+
. Removed (unset) cast.
2425
. Removed track_errors ini directive. This means that $php_errormsg is no
2526
longer available. The error_get_last() function may be used instead.
2627
. Removed create_function(). Anonymous functions may be used instead.

Zend/tests/unset_cast_deprecated.phpt

Lines changed: 0 additions & 14 deletions
This file was deleted.

Zend/tests/unset_cast_removed.phpt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
--TEST--
2+
The (unset) cast is removed
3+
--FILE--
4+
<?php
5+
6+
$x = 1;
7+
var_dump((unset) $x);
8+
var_dump($x);
9+
10+
?>
11+
--EXPECTF--
12+
Fatal error: The (unset) cast is no longer supported in %s on line %d

Zend/zend_compile.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7184,7 +7184,7 @@ void zend_compile_cast(znode *result, zend_ast *ast) /* {{{ */
71847184
opline->extended_value = ast->attr;
71857185

71867186
if (ast->attr == IS_NULL) {
7187-
zend_error(E_DEPRECATED, "The (unset) cast is deprecated");
7187+
zend_error(E_COMPILE_ERROR, "The (unset) cast is no longer supported");
71887188
}
71897189
}
71907190
/* }}} */

0 commit comments

Comments
 (0)