logo CodeStepByStep logo

collection_mystery1

Language/Type: PHP collection mysery collections Stack

What is the output of the following code?

$s = [];
array_push($s, 7);
array_push($s, 10);
print($s[count($s) - 1] . " ");
print(array_pop($s) . " ");
array_push($s, 3);
array_push($s, 5);
print(array_pop($s) . " ");
print(count($s) . " ");
print($s[count($s) - 1] . " ");
array_push($s, 8);
print(array_pop($s) . " ");
print(array_pop($s) . " ");
Output
(order shuffled)

You must log in before you can solve this problem.

Log In

Need help?

Stuck on an exercise? Contact your TA or instructor.

If something seems wrong with our site, please

Is there a problem? Contact us.