Find the output of the following code snippet.
$bar = <<< 1;Anna;eats mangoes
2;Mark;eats apples
EOF;
function bar_parser($bar) {
foreach (explode("\n", $bar) as $I) {
$foo = explode(';', $I);
$id = array_shift($foo);
yield $id => $foo;
}
}
foreach (bar_parser($bar) as $id => $foo) {
echo "$id:\n";
echo" $foo[0]\n";
echo" $foo[1]\n";
}
?>
Correct Answer:
Compilation error.
Explanation:
Note: This Question is unanswered, help us to find answer for this one
More PHP 5 MCQ Questions