@timbray Classic overengineered solution. It needs to be simple enough for anyone to understand. Currently it is not simple enough for people who work as programmers to understand.
One of these days I'll break and make Count Wordula, the word processor for people who are really into counting words but don't really need any other function of a word processor apart from maybe bold and italics
Marketing website: "Wow, Bonkadonk makes collecting payments so easy, even my cat can do it! Now he runs his own fancy collars business. Thanks Bonkadonk."
Emails to customers: "We have just deprecated the C-7 GX Rootytooty trust chain as part of our move to GlobalSecure root chain v4. What does this mean for me? You will need to update..."
More websites should say "Wow, this made a difficult task somewhat less difficult, though also still requiring regular maintenance and basic competence."
You may have seen the Balatro Discourse, which consists of people looking at a screenshot of code that it straightforward and getting angry that it's not more complicated.
I'd just like to posit here that a straightforward solution is an excellent default and you should have a really solid argument for the advantages of a complicated solution before you choose it.
Pop quiz: can you spot the problem in this PHP snippet? I just got tripped up by it and it was very Not Fun. (This is rewritten to be a minimal example.)
if ( $coolness > 10 ) {
define('COOL_MODE', true);
}
The PHP7 behaviour is that if the constant COOL_MODE is undefined, then it returns the string "COOL_MODE". This in turn evaluates to true or 1, triggering code paths you didn't expect.
PHP8 has the more 'correct' but also breaking behaviour that I ran into: if you try to make any comparison with an undefined constant, then instead of returning false it returns an error. And if you do not catch it then it is a fatal error, your page returns a 500.
@datarama@abucci In general – and hardly anyone agrees with this – I preferred old-PHP's "render something, even possibly completely the wrong thing if you have a weird logic bug" approach to new-PHP dropping fatal errors and hard stops all over the place
@Geoff@datarama@abucci I think it's more that they want to focus on an audience that's building "apps" instead of pages.
When you're just adding some widget to a page, you want it to just error out and the rest of the page to still continue. You don't want execution to 'correctly' stop on error.