Zend
200-710 · Question #86
What is the output of the following code? function increment ($val) { $_GET['m'] = (int) $_GET['m'] + 1; } $_GET['m'] = 1; echo $_GET['m'];
The correct answer is A. 1. See the full explanation below for the reasoning.
Functions
Question
What is the output of the following code?
function increment ($val)
{
$_GET['m'] = (int) $_GET['m'] + 1;
}
$_GET['m'] = 1;
echo $_GET['m'];
Options
- A1
How the community answered
(15 responses)- A100% (15)
Topics
#superglobals#$_GET#function scope#type casting
Community Discussion
No community discussion yet for this question.