What are the conversion rules for strings to ints in PHP?
For example I have the following that return 0:
var_dump((int)"test0");
var_dump((int)"test1");
var_dump((int)"test2");
and it appears that if the string starts with a digit then it will trim the characters and use the digit part only. As follows:
var_dump((int)"1test");
var_dump((int)"2test");
var_dump((int)"3test");
These return 1, 2 and 3 respectively.
Now, is this a definite rule, or are there exceptions to this?