File tree Expand file tree Collapse file tree 4 files changed +24
-0
lines changed Expand file tree Collapse file tree 4 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ PHP NEWS
11
11
. Fixed bug GH-15181 (Disabled output handler is flushed again). (cmb)
12
12
. Passing E_USER_ERROR to trigger_error() is now deprecated. (Girgias)
13
13
. Fixed bug GH-15292 (Dynamic AVX detection is broken for MSVC). (nielsdos)
14
+ . Using "_" as a class name is now deprecated. (Girgias)
14
15
15
16
- Curl:
16
17
. Added constants CURL_HTTP_VERSION_3 (libcurl 7.66) and CURL_HTTP_VERSION_3ONLY
Original file line number Diff line number Diff line change @@ -410,6 +410,8 @@ PHP 8.4 UPGRADE NOTES
410
410
RFC: https://wiki.php.net/rfc/deprecate-implicitly-nullable-types
411
411
. Passing E_USER_ERROR to trigger_error() is now deprecated.
412
412
RFC: https://wiki.php.net/rfc/deprecations_php_8_4#deprecate_passing_e_user_error_to_trigger_error
413
+ . Using "_" as a class name is now deprecated.
414
+ RFC: https://wiki.php.net/rfc/deprecations_php_8_4#deprecate_using_a_single_underscore_as_a_class_name
413
415
414
416
- Curl:
415
417
. The CURLOPT_BINARYTRANSFER constant is deprecated.
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ Using "_" as a class name is deprecated
3
+ --FILE--
4
+ <?php
5
+
6
+ namespace Foo \Bar {
7
+ class _ {}
8
+ }
9
+
10
+ namespace {
11
+ class _ {}
12
+ }
13
+
14
+ ?>
15
+ --EXPECTF--
16
+ Deprecated: Using "_" as a class name is deprecated since 8.4 in %s on line %d
17
+
18
+ Deprecated: Using "_" as a class name is deprecated since 8.4 in %s on line %d
Original file line number Diff line number Diff line change @@ -243,6 +243,9 @@ void zend_assert_valid_class_name(const zend_string *name) /* {{{ */
243
243
zend_error_noreturn (E_COMPILE_ERROR ,
244
244
"Cannot use '%s' as class name as it is reserved" , ZSTR_VAL (name ));
245
245
}
246
+ if (zend_string_equals_literal (name , "_" )) {
247
+ zend_error (E_DEPRECATED , "Using \"_\" as a class name is deprecated since 8.4" );
248
+ }
246
249
}
247
250
/* }}} */
248
251
You can’t perform that action at this time.
0 commit comments