beberlei / assert

Thin assertion library for use in libraries and business-model
Other
2.41k stars 186 forks source link

Added better integerish tests and assertion. #227

Closed guyradford closed 7 years ago

guyradford commented 7 years ago

Strings with spaces at the begining and or end were handled differently. This fix makes both now fail.

acasademont commented 7 years ago

HI @guyradford and @localheinz we're having problems with this change. A string '01' or any string with a leading 0 will not be considered integerish, which IMHO is wrong. Is this the expected behavior?

rquadling commented 7 years ago

If the intent is for it to be an octal string, then according to http://php.net/manual/en/language.types.integer.php#111523, this is not the case.

intval() does correctly identify an integer from "0123". So this is a bug.