Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Zend Exam 200-710 Topic 8 Question 50 Discussion

Actual exam question for Zend's 200-710 exam
Question #: 50
Topic #: 8
[All 200-710 Questions]

What is the output of the following code?

function increment ($val)

{

++$val;

}

$val = 1;

increment ($val);

echo $val;

Show Suggested Answer Hide Answer
Suggested Answer: B

Contribute your Thoughts:

Ashley
6 days ago
Actually, the output is 1 because the increment function is not returning the updated value.
upvoted 0 times
...
Yesenia
7 days ago
I think the output is 2 because the increment function should increase the value by 1.
upvoted 0 times
...
Colby
7 days ago
Wait, why is the output not 1? Isn't the function just incrementing the value and then returning it? I'm confused.
upvoted 0 times
...
Ashley
8 days ago
The output is 1.
upvoted 0 times
...
Linette
10 days ago
Actually, the output is 1 because the function is not returning the incremented value.
upvoted 0 times
...
Georgeanna
18 days ago
The output will be 2. The increment operator (++) increments the value of $val by 1, so after calling the increment() function, the value of $val should be 2.
upvoted 0 times
...
Lura
19 days ago
I think the output will be 2 because the function is incrementing the value.
upvoted 0 times
...
Linette
25 days ago
The output is 1.
upvoted 0 times
...

Save Cancel
az-700  pass4success  az-104  200-301  200-201  cissp  350-401  350-201  350-501  350-601  350-801  350-901  az-720  az-305  pl-300  

Warning: Cannot modify header information - headers already sent by (output started at /pass.php:70) in /pass.php on line 77