4 ms·
All of this I can understand, but why then octal numbers are not compared the same way is beyond me? var_dump(0xA == '0xA'); // bool(true) var_dump(012
by ivanhoe 11y ago
All of this I can understand, but why then octal numbers are not compared the same way is beyond me?
var_dump(0xA == '0xA'); // bool(true)
var_dump(012 == '012'); // bool(false)
- seanp2k2 11y agoCheck out which types those examples get cast to and it should make more sense :) I don't know the exact rules for type detection in PHP, but it looks like that's the cause.