Skip to content

Latest commit

 

History

History
23 lines (19 loc) · 535 Bytes

0391.md

File metadata and controls

23 lines (19 loc) · 535 Bytes

The PHP function array_reduce() is used to turn an array into a single value using a custom callback. What is the output of the following script?

function reducer($total$elt) {
    return $elt + $total;
}
$arr = [12345];
echo array_reduce($arr'reducer'1);
  • A) 16
  • B) 14
  • C) 0
  • D) 15
Answer

Answer: A