Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
skanna3458y@fatlard1993 sorry space has been added by mistake probably by the mobile keyboard :/
Try executing them (without that space in the string) -
skanna3458y@TheBoJaN if you `(bool) 0` === false, while if you `(book) !0` === true.
this means the String "x" is at the same time a true value (because it's a not-empty string) and a false value (because a theoretical hex"0x0" would be 0 in integer, so a false) -
TheBoJaN138yInteresting. I'd assume PHP would not know what to do with the ! Operator in that case and return the value of O to avoid errors, but I haven't touched PHP in over 10 years so idk
Related Rants
When a condition is true and false at the same time...
var_dump(0 == "x"); // true
var_dump(!0 == " x"); // true
WTF?!
I started using the === more often...
undefined
php