What is the output of the following code snippet?$a = ‘5’; echo $a + 10 . 5;

PHP Intermediate Hard

PHP Intermediate — Hard

What is the output of the following code snippet?$a = ‘5’; echo $a + 10 . 5;

Key points

  • Arithmetic operators trigger numeric type juggling
  • Concatenation operator has lower precedence than addition
  • Resulting types are cast to strings for concatenation

Ready to go further?

Related questions