Reputation: 43
Why this php code evals to true? Was thinking maybe some kind of casting, but can't find any related info. Any ideas?
var_dump(5 < [6]);
Upvotes: 0
Views: 175
Reputation: 2560
In php documentation on comparison operator http://php.net/manual/en/language.operators.comparison.php, in chapter Comparison with Various Types:
array | anything | array is always greater
So, there is no casting. It's sort of hard-coded.
Upvotes: 3