What is the output of the following code snippet? $a = 0123; echo $a;

PHP Intermediate Medium

PHP Intermediate — Medium

What is the output of the following code snippet? $a = 0123; echo $a;

Key points

  • Leading zeros trigger octal interpretation
  • Octal base uses digits 0-7
  • PHP integer literals are base-10 by default

Ready to go further?

Related questions