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 200-710 Exam - Topic 9 Question 65 Discussion

What is the output of the following code?$f = function () { return "hello"; };echo gettype($f);
A) hello
B) string
C) object
D) function

Zend 200-710 Exam - Topic 9 Question 65 Discussion

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

What is the output of the following code?

$f = function () { return "hello"; };

echo gettype($f);

Show Suggested Answer Hide Answer
Suggested Answer: A

Contribute your Thoughts:

0/2000 characters
Mireya
8 months ago
I thought it would be an object, but I guess I was wrong!
upvoted 0 times
...
Melodie
9 months ago
No way, it's definitely not a string.
upvoted 0 times
...
Dean
9 months ago
Wait, isn't it just a string since it returns "hello"?
upvoted 0 times
...
Lashaunda
9 months ago
Definitely going with D!
upvoted 0 times
...
Irma
9 months ago
It's a function, so the output is "function".
upvoted 0 times
...
Ernest
10 months ago
I’m leaning towards "object" because it seems like functions are treated as objects in some contexts, but I could be wrong.
upvoted 0 times
...
Deangelo
10 months ago
I'm a bit confused because I thought gettype would return the type of the return value, but I guess it returns the type of the variable itself?
upvoted 0 times
...
Alease
10 months ago
I remember practicing a similar question where we had to identify the type of a variable, and it was about functions too. I feel like the answer is D.
upvoted 0 times
...
Shay
10 months ago
I think the output should be "function" since $f is a function variable, but I'm not entirely sure.
upvoted 0 times
...
Isidra
10 months ago
Okay, I think I've got it. The `gettype()` function will return the data type of the variable `$f`, which is a function. So the answer is D.
upvoted 0 times
...
Catherin
10 months ago
I'm a bit confused here. The function is being assigned to a variable, so I'm not sure if the output will be the string "hello" or the data type of the variable. I'll need to double-check my understanding.
upvoted 0 times
...
Lacresha
10 months ago
I'm pretty confident the answer is B. The `gettype()` function will return the data type of the variable, which in this case is a string since the function returns a string.
upvoted 0 times
...
Jannette
10 months ago
Okay, let's see. The code defines a function that returns "hello", and then we're asked about the output of `gettype($f)`. I'm guessing it's going to be "function".
upvoted 0 times
...
Luann
10 months ago
Hmm, this looks like a tricky one. I'll need to think it through carefully.
upvoted 0 times
...
Janessa
10 months ago
Hmm, this question seems pretty straightforward. I think I've got a good handle on how KMS envelope encryption works, so I should be able to identify the incorrect statement.
upvoted 0 times
...
Casie
10 months ago
This seems like a complex question with a lot of details to consider. I'll need to carefully read through the scenario and the options to determine the best approach.
upvoted 0 times
...
Louvenia
10 months ago
Hmm, I'm a little unsure about this one. I know piece rate and commissions are individual incentive plans, but I can't quite remember if profit-sharing counts as a group plan or not.
upvoted 0 times
...
Aliza
11 months ago
I feel pretty confident that the answer is Occupational Noise Exposure. OSHA definitely has standards in place to protect workers from excessive noise levels in the workplace. That seems like the most relevant option here.
upvoted 0 times
...
Celestina
1 year ago
I wonder if there's a secret 'E) Spaghetti' option hidden in the code somewhere...
upvoted 0 times
...
Laurena
1 year ago
Well, if I don't know the answer, I'll just take a wild guess and choose 'hello'. What could go wrong?
upvoted 0 times
...
Zoila
1 year ago
D. function - that's an easy one, I can't believe anyone would choose anything else!
upvoted 0 times
Alpha
1 year ago
D) function - that's an easy one, I can't believe anyone would choose anything else!
upvoted 0 times
...
Elizabeth
1 year ago
C) object
upvoted 0 times
...
Rolland
1 year ago
B) string
upvoted 0 times
...
Diego
1 year ago
A) hello
upvoted 0 times
...
...
Nada
1 year ago
Hmm, I'd guess 'object' since functions are considered objects in PHP.
upvoted 0 times
Nicolette
1 year ago
Correct, it's B) string
upvoted 0 times
...
Leatha
1 year ago
I think it's D) function
upvoted 0 times
...
Noel
1 year ago
B) string
upvoted 0 times
...
...
Lashawna
1 year ago
The output should be 'function' since the variable $f is assigned a function.
upvoted 0 times
Inocencia
1 year ago
Oh, I see. Thanks for clarifying!
upvoted 0 times
...
Kenneth
1 year ago
No, the output is 'object' because the variable $f is assigned a function.
upvoted 0 times
...
Elfriede
1 year ago
B) string
upvoted 0 times
...
...
Lili
1 year ago
D) function
upvoted 0 times
...
Jeff
1 year ago
I think the output is B) string because the function returns a string value.
upvoted 0 times
...
Chantell
1 year ago
B) string
upvoted 0 times
...
Gilbert
1 year ago
D) function
upvoted 0 times
...
Sharika
1 year ago
I think it's B) string because the function returns a string.
upvoted 0 times
...
Shenika
1 year ago
B) string
upvoted 0 times
...

Save Cancel