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 🤷🏻‍♂️

@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 ...

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.