A #PHP global constant redefinition is a simple warning.
A #PHP class constant redefinition is a full Fatal Error.
I am so used to the Fatal error, that I expected the global constant to behave the same. Shouldn't they?
[#]phptip #phptrick
https://php-tips.readthedocs.io/en/latest/tips/constant_redefinition.html
=> More informations about this toot | More toots from dseguy@phpc.social
@dseguy Fanatical dedication to backwards compatibility, innit? I susect there was concern over breaking WP or something.
=> More informations about this toot | More toots from pollita@phpc.social
@pollita It would leave a lot of WP installations unusable. And hinder further upgrades...
Because blaming the shitty BC policy of the PHP-team is much easier than fixing shitty code and check whether a constant is already defined before redefining it...
/cc @dseguy
=> More informations about this toot | More toots from heiglandreas@phpc.social
@heiglandreas @pollita @dseguy I've never figured out who these admins are that upgrade #PHP on the server but not #WordPress on the site. 🤔
=> More informations about this toot | More toots from syntaxseed@phpc.social
@syntaxseed Those that maintain shared hosting where users can install whatever they want?
And users then decide to not use the providers supplied oneclick installer... And also never update WP because "It'll break 😱"
I've seen things.... 🙈
/cc @pollita @dseguy
=> More informations about this toot | More toots from heiglandreas@phpc.social
@heiglandreas @pollita @dseguy I use a lot of shared hosting. Never had the PHP version change from under me- typically I go to my control panel & can choose from versions currently available. I then have to flip the "switch" in order to upgrade PHP.
I feel like people who don't bother with WP upgrades aren't going to do either.
If the version changes from under you, either the host is awful or you ignored years of warnings (we've been getting 5.x discontinuation notices for many years. 🤣
=> More informations about this toot | More toots from syntaxseed@phpc.social
@heiglandreas @pollita @dseguy But yeah... I'm sure the horror stories are everywhere!
I'm just not sure that "we" (PHP) should be shielding them. 😉
=> More informations about this toot | More toots from syntaxseed@phpc.social
@syntaxseed I hope you didn't get me wrong: We shouldn't!
/cc @pollita @dseguy
=> More informations about this toot | More toots from heiglandreas@phpc.social
@heiglandreas @pollita @dseguy Nope, I was agreeing with you. 😊
=> More informations about this toot | More toots from syntaxseed@phpc.social This content has been proxied by September (ba2dc).Proxy Information
text/gemini