Skip to content

Latest commit

 

History

History
42 lines (32 loc) · 525 Bytes

0795.md

File metadata and controls

42 lines (32 loc) · 525 Bytes

What is displayed when the following code is executed?

$array = array(1, 2, 3, 4, 5);
foreach ($array as $i => $value) {
    unset($array[$i]);
}

$array[] = 6;
print_r($array);
  • A)
Array( [5] => 6)
  • B)
Array()
  • C)
Array([0] => 6)
  • D)
Array( [6] => 6)
Answer

Answer: A