nerdexam
Zend

200-530 · Question #468

You run the following PHP script: <?php $array1 = array ('a' => 20, 30, 35); $array2 = array ('b' => 20, 35, 30); $array = array_intersect_assoc ($array1, $array2); var_dump ($array); ?> What will…

The correct answer is D. array(0) { }. See the full explanation below for the reasoning.

Question

You run the following PHP script: <?php $array1 = array ('a' => 20, 30, 35); $array2 = array ('b' => 20, 35, 30); $array = array_intersect_assoc ($array1, $array2); var_dump ($array); ?> What will be the output?

Options

  • Aarray(3) { ["'a'"]=> int(20) [0]=> int(30) [1]=> int(35) }
  • Barray(1) { ["'a'"]=> int(20)}
  • CThe script will throw an error message.
  • Darray(0) { }

How the community answered

(18 responses)
  • A
    6% (1)
  • B
    11% (2)
  • C
    6% (1)
  • D
    78% (14)

Community Discussion

No community discussion yet for this question.

Full 200-530 Practice