What is the result of $a = null; $b = (int) $a; $c = (string) $a;?

PHP Intermediate Hard

PHP Intermediate — Hard

What is the result of $a = null; $b = (int) $a; $c = (string) $a;?

Key points

  • Null to int conversion is 0.
  • Null to string conversion is an empty string.
  • Type casting null does not preserve the null value.

Ready to go further?

Related questions