What will be the output of the following PHP code?

<?php
$a = [10, 20, 30];
$b = 25;
var_dump(is_array($a));
var_dump(is_array($b));
?>
                        

Options

  • A. true true
  • B. false false
  • C. true false
  • D. More than one of the above
  • E. None of the above

Correct Answer (Detailed Explanation is Below)

C. true false

Detailed Explanation

Correct Answer: Option C

Explanation:
The variable $a contains an array, so is_array($a) returns true. The variable $b contains an integer, so is_array($b) returns false. var_dump() displays the Boolean values as bool(true) and bool(false).