Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
ivanhoe
on May 4, 2015
|
parent
|
context
|
favorite
| on:
PHP: md5('240610708') == md5('QNKCDZO')
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
on May 4, 2015
[–]
Check 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.
Consider applying for YC's Summer 2026 batch! Applications are open till May 4
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: