Skip to content

Latest commit

 

History

History
34 lines (28 loc) · 818 Bytes

0073.md

File metadata and controls

34 lines (28 loc) · 818 Bytes

Consider the following PHP script:

$base_array = array("red""green""yellow""white");
$replacements_array = array(0 => "orange"4 => "blue");
$result = array_replace($base_array$replacements_array);
print_r($result);

What will be the output of the script?

  • A)
Array ( [0] => orange [1] => green [2] => yellow [3] => white [4] => blue )
  • B) Script will throw an error message.
  • C)
Array ( [0] => blue [1] => white [2] => yellow [3] => green [4] => orange )
  • D)
Array ( [0] => yellow [1] => white [2] => blue [3] => green [4] => orange )
Answer

Answer: A