What does the following code output? $i = 016; echo $i / 2;
TechnicalSenior php developerPHP DeveloperBackend DeveloperThe output of the code is 6. In PHP, when a number starts with a 0, it's treated as an octal number. Thus, 016 is interpreted as 14 in decimal. Dividing 14 by 2 gives us 7.
It's important to note that using leading zeros can lead to confusion and unexpected results, so it's best to avoid them unless necessary.