Discussion :: PHP - CS
-
What will be the output of the following code?
<?php
function track()
{
static $count = 0;
$count++;
echo $count;
}
track();
track();
track();
?>
Answer : Option A
Explanation :
Because $count is static, it retains its previous value each time the function is executed.
Be The First To Comment