You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<?phpnamespaceFoo {
class __ {}
}
namespaceBar {
class _ {} // Deprecated
}
namespace {
class __ {}
class_alias('Foo\__', 'Foo\_'); // Is this meant to be deprecated?class_alias('__', '_'); // Deprecated
}
namespaceBaz {
useFoo\_;
}
namespaceQux {
useFoo\__as_; // Is this meant to be deprecated?
}
Resulted in this output:
Deprecated: Using "_" as a class name is deprecated since 8.4 in /in/ZZMJs on line 8
Deprecated: Using "_" as a class alias is deprecated since 8.4 in /in/ZZMJs on line 15
But I expected this output instead:
Deprecated: Using "_" as a class name is deprecated since 8.4 in /in/ZZMJs on line 8
Deprecated: Using "_" as a class alias is deprecated since 8.4 in /in/ZZMJs on line 14
Deprecated: Using "_" as a class alias is deprecated since 8.4 in /in/ZZMJs on line 15
Deprecated: Using "_" as a class alias is deprecated since 8.4 in /in/ZZMJs on line 23
I encountered this issue while trying to migrate a large closed source project to PHP 8.4. The namespaced _ class was used as a wrapper for the gettext _ function (eg new _("string")), to delay performing the translation of cached content until the http response is stringified. The class had ~35k instantiations in source control and more instances in compressed + serialized database records. This made class aliases a potentially appealing solution, but I understand from @Girgias that these not emitting deprecation errors is an oversight.
PHP Version
8.4.1 - 8.4.6 on 3v4l
Operating System
No response
The text was updated successfully, but these errors were encountered:
Description
The following code:
Resulted in this output:
But I expected this output instead:
I encountered this issue while trying to migrate a large closed source project to PHP 8.4. The namespaced
_
class was used as a wrapper for the gettext_
function (egnew _("string")
), to delay performing the translation of cached content until the http response is stringified. The class had ~35k instantiations in source control and more instances in compressed +serialize
d database records. This made class aliases a potentially appealing solution, but I understand from @Girgias that these not emitting deprecation errors is an oversight.PHP Version
8.4.1 - 8.4.6 on 3v4l
Operating System
No response
The text was updated successfully, but these errors were encountered: