Let's suppose I have a code which outputs
$i = 016;
echo $i / 2;
//ans will be 7
When you preceed integers with zero in PHP, in that instance,
It becomes octal.
So when you echo that, it will convert to its decimal form.
Which results to:
echo 016; //14 (decimal) valid octal echo 029; // 2 (decimal) - Invalid octal
Actually, its here stated in the manual
octal : 0[0-7]+
Note: Prior to PHP 7, if an invalid digit was given in an octal integer (i.e. 8 or 9), the rest of the number was ignored. Since PHP 7, a parse error is emitted.