News for hackers. Stuff that matters.
Re:PHP 8.1.0 by jdjdjrj on Thursday November 25, 2021 @04:23PM (#29345121)
Say what you want about PHP, but here we are decades later. I'm still using it, it still works, and it's still getting updated and improved.
Re:PHP 8.1.0 by 0x4d464d48 on Thursday November 25, 2021 @05:39PM (#29345662)
Say what you will about JavaScript...

I use it constantly not because it's well-designed but because TINA (there is no alternative).

[] == ![]; // true. Go ahead. Run it in your console...

Re:PHP 8.1.0 by stefanos82 on Thursday November 25, 2021 @06:21PM (#29345964)
...so it basically is `0 == ![]`, in other words, `[].length` which is `0`, thus becomes `0 == false` which returns `true` with loose comparison?
Re:PHP 8.1.0 by 0x4d464d48 on Thursday November 25, 2021 @07:05PM (#29346256)
Yep.

Because an array is an object which has a 'truthy' value '![]' evaluates as 'false'.

Simplifies to a statement similar to 'false == false'.

A little useless arcana for those interested.

Well, not so useless if your expecting '!someEmptyArray' to evaluate to 'true'. Use '!someEmptyArray.length' instead.

Re:PHP 8.1.0 by npteljes on Friday November 26, 2021 @03:22AM (#29348368)
What is this argument for, or against?