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

PHP Intermediate Hard

PHP Intermediate — Hard

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

Key points

  • Integer literals starting with '0' are treated as octal.
  • Octal numbers only contain digits 0 through 7.
  • PHP automatically converts numeric types to strings during output.

Ready to go further?

Related questions