worldsendless,
@worldsendless@qoto.org avatar

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.

amarok,
@amarok@mastodonczech.cz avatar

@worldsendless
PHP had some flaws and problems so it was simply necessary to do a radical change at some point. Everything has been announced in advance, and there's always been a "deprecated" flag in advance to warn programmers. It's just like it is, I'm glad the PHP team finally released 8 where almost everything behaves like expected (and now the language is far better than , IMHO).

worldsendless,
@worldsendless@qoto.org avatar

@amarok !!! What leads you to think it better than JS? (not a JS lover here, but historically I hate it less than old PHP)

Crell,
@Crell@phpc.social avatar

@worldsendless @amarok PHP is now effectively a typed language. JS is not. (TS doesn't count.)

JS async is just a mess to work with.

The Packagist ecosystem is vastly more robust and reliable than npm/yarn/whatever.

Oth still have warts from their youth, and both have improved dramatically in the last decade. But I'd still rather work in PHP than JS most of the time for the type system alone.

Crell,
@Crell@phpc.social avatar

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

arnan,

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

kevin,
@kevin@dice.camp avatar

@arnan @Crell @worldsendless Nested ternaries deserve to be broken.

worldsendless,
@worldsendless@qoto.org avatar

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

Crell,
@Crell@phpc.social avatar

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

arnan,

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

Crell,
@Crell@phpc.social avatar

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

worldsendless,
@worldsendless@qoto.org avatar

@Crell No kidding! It's had an open ticket to match their versions for months now, but upgrading the PHP version on shared servers is complicated. I definitely miss our solid Clojure setups.

Crell,
@Crell@phpc.social avatar

@worldsendless containerized dev envs FTW.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • php
  • DreamBathrooms
  • ngwrru68w68
  • modclub
  • magazineikmin
  • thenastyranch
  • rosin
  • khanakhh
  • InstantRegret
  • Youngstown
  • slotface
  • Durango
  • kavyap
  • mdbf
  • GTA5RPClips
  • JUstTest
  • tacticalgear
  • normalnudes
  • tester
  • osvaldo12
  • everett
  • cubers
  • ethstaker
  • anitta
  • provamag3
  • Leos
  • cisconetworking
  • megavids
  • lostlight
  • All magazines