|
|
|
|
|
by CraneWorm
2038 days ago
|
|
0 == 'foobar' // false
> When comparing to a numeric string, PHP 8 uses a number comparison. Otherwise, it converts the number to a string and uses a string comparison.Why do the conversion at all? Why couldn't this just be an error? I realise there is also `===` the strict comparison that typechecks arguments, but why not make that the default? |
|
you mean crash your program? So your user finds a way to send you an int instead of a string, or vice versa, and now they can crash your webserver.