We borrowed some code from that had nested ternaries without parenthesis. Turns out that as a fatal error in PHP 8 on our production server but not on the earlier PHP on our development server. Wow... a language with breaking syntax changes. I'll stick with sound , where you never have too few parenthesis.

@worldsendless Turns out running different versions in dev and prod while copying and pasting code from Stack Overflow is a bad combination... 🙂

@Crell @worldsendless Sounds like a case of poorly written PHP to me 🤷🏻‍♂️

Follow

@kevin @arnan @Crell I agree! I'm just surprised they got under my radar. They are like a diabolic cond wannabe

@worldsendless @kevin @arnan And were even broken in earlier PHP versions, because the default grouping logic was backward from literally every other language that has ternaries. 🙂 That's why it changed to make the () required, so that the language could transition to a more sensible grouping over time.

@Crell @worldsendless @kevin yea I was gonna say, isn't that change just a move toward better structure and usability that has been ongoing since php 5 or so? Take out ambiguity and loose code standards and such ...

@arnan @worldsendless @kevin Yes, PHP has been on a decade long effort to fix all the dumb mistakes made in the 90s. Some of that cannot be done without some degree of breakage, but the internals team tries very hard to make it small and gradual as much as possible.

Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.