Earlier quoted context omitted.
That's exactly what I was expecting to read about upon seeing the article title. But apparently they deprecated and then changed(?!) the associativity in the past few years, which if anything just makes things even more confusing.
This changed 6 years ago in 8.0, a major version change. Once again showing how out of date peoples hate for PHP is
PHP's Oddities
161–170 of 186 posts
Re: PHP's Oddities
#162Earlier quoted context omitted.
Lol to true. Who even uses twig or smarty anymore hesitantly raises hand
I have a client I've been working with for decades (because they're great people to work with), maintaining and improving their php code base that still uses Smarty templates. So I know and hate Smarty from first hand experience, and appreciate what a terrible idea Smarty is and why. I've also extensively used Zope and Plone, which attempt to give designers a "safe" set of capabilities and subset of Python which was…
Re: PHP's Oddities
#163> This lax behaviour for property definitions makes writing code around them harder. Especially when you take into account that any object can have properties dynamically added to them: Doing so now raises a deprecation warning, unless you add #[AllowDynamicProperties], and PHP 9 will convert it to an error. I'm told this will simplify internals and unlock optimizations. Arrays are still fairly awful, but generics ma…
Not sure why a language that barely has a type system needs generics.
Re: PHP's Oddities
#164Re: PHP's Oddities
#165Earlier quoted context omitted.
That's exactly what I was expecting to read about upon seeing the article title. But apparently they deprecated and then changed(?!) the associativity in the past few years, which if anything just makes things even more confusing.
This changed 6 years ago in 8.0, a major version change. Once again showing how out of date peoples hate for PHP is
Re: PHP's Oddities
#166Re: PHP's Oddities
#167if("0") {} being equivalent to if(false) {} still gives me nightmares even though I've stopped using PHP for at least 6 years now :)
In what context are you doing if("0")? People always have these obscure type comparison complaints, not just for PHP, and all I can think is why would you write that?
if ($input) {}
It'll work through every test case you try, and then someone enters a 0 into the field and it's also unexpectedly considered empty.Re: PHP's Oddities
#168Earlier quoted context omitted.
Maybe that’s because a site last updated 8 years ago is utterly irrelevant for, like, anything?
It’s not so irrelevant if your org is stuck on older versions of PHP.
Re: PHP's Oddities
#169After over two decades of working in PHP, I'm now working in Java. PHP is basically Java-lite. I am absolutely loving the compile-time safety of Java, but I dearly miss PHP's maps and arrays. In Java, the amount of verbosity for defining a map/list and operating on it is overwhelming. Modern PHP is great. Many powerful language features, excellent performance, great community and package ecosystem, and decent enough…
> If you really do need the first element, you can use array_first That probably needs an array_second too, doesn't it? Maybe array_second_from_last as well?
Re: PHP's Oddities
#170But it doesn't have Perl's brevity: https://imgur.com/a/CfRqh5X