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

Posted by Michal on May 08, 2024 at 01:57 PM

What is the output of the following code?

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

echo gettype($f);

Suggested Answer: A

Get Premium 200-710 Questions as Interactive Web-Based Practice Test or PDF Real Exam Format Detailed Explanations Instant Access Get Your Practice Test
39 comments · newest first
MI
Mireya 11 months ago
I thought it would be an object, but I guess I was wrong!
ME
Melodie 12 months ago
No way, it's definitely not a string.
DE
Dean 12 months ago
Wait, isn't it just a string since it returns "hello"?
LA
Lashaunda 1 year ago
Definitely going with D!
IR
Irma 1 year ago
It's a function, so the output is "function".
ER
Ernest 1 year ago
I’m leaning towards "object" because it seems like functions are treated as objects in some contexts, but I could be wrong.
DE
Deangelo 1 year 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?
AL
Alease 1 year 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.
SH
Shay 1 year ago
I think the output should be "function" since $f is a function variable, but I'm not entirely sure.
IS
Isidra 1 year 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.
CA
Catherin 1 year 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.
LA
Lacresha 1 year 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.
JA
Jannette 1 year 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".
LU
Luann 1 year ago
Hmm, this looks like a tricky one. I'll need to think it through carefully.
JA
Janessa 1 year 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.
CA
Casie 1 year 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.
LO
Louvenia 1 year 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.
AL
Aliza 1 year 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.
CE
Celestina 1 year ago
I wonder if there's a secret 'E) Spaghetti' option hidden in the code somewhere...
LA
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?
ZO
Zoila 1 year ago
D. function - that's an easy one, I can't believe anyone would choose anything else!
AL
Alpha 1 year ago
↳ replying to Zoila
D) function - that's an easy one, I can't believe anyone would choose anything else!
EL
Elizabeth 1 year ago
↳ replying to Zoila
C) object
RO
Rolland 1 year ago
↳ replying to Zoila
B) string
DI
Diego 1 year ago
↳ replying to Zoila
A) hello
NA
Nada 2 years ago
Hmm, I'd guess 'object' since functions are considered objects in PHP.
NI
Nicolette 1 year ago
↳ replying to Nada
Correct, it's B) string
LE
Leatha 1 year ago
↳ replying to Nada
I think it's D) function
NO
Noel 1 year ago
↳ replying to Nada
B) string
LA
Lashawna 2 years ago
The output should be 'function' since the variable $f is assigned a function.
IN
Inocencia 1 year ago
↳ replying to Lashawna
Oh, I see. Thanks for clarifying!
KE
Kenneth 1 year ago
↳ replying to Lashawna
No, the output is 'object' because the variable $f is assigned a function.
EL
Elfriede 1 year ago
↳ replying to Lashawna
B) string
LI
Lili 2 years ago
D) function
JE
Jeff 2 years ago
I think the output is B) string because the function returns a string value.
CH
Chantell 2 years ago
B) string
GI
Gilbert 2 years ago
D) function
SH
Sharika 2 years ago
I think it's B) string because the function returns a string.
SH
Shenika 2 years ago
B) string
0/2000 characters

Save Cancel