echo intval(chr(255));
I don't understand...
The chr()
function turns a byte into its ASCII equivalent and intval()
function gets the integer value of a variable.
If we were to break the statement into two different lines, this would be:
$a = chr(255); // $a is now a string
echo intval($a);
If you check intval()
's documentation you will notice that:
Strings will most likely return 0 although this depends on the leftmost characters of the string. The common rules of integer casting apply.
That's why the result is zero.