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 2 Question 42 Discussion

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

What is the output of the following code?

class a

{

public $val;

}

function renderVal (a $a)

{

if ($a) {

echo $a->val;

}

}

renderVal (null);

Show Suggested Answer Hide Answer
Suggested Answer: A

Contribute your Thoughts:

Colby
4 days ago
Hmm, I'm going with option D. The function is checking if the $a parameter is truthy, and null is a falsy value, so it should output NULL.
upvoted 0 times
...
Tanja
7 days ago
I'm pretty sure option B is the correct answer. Passing a null value to a function that expects an instance of a class will result in an error.
upvoted 0 times
...
Carman
15 days ago
I agree with Arlene, it should be an error.
upvoted 0 times
...
Arlene
18 days ago
I believe it's an error, because null is not an instance of 'a'.
upvoted 0 times
...
Kaitlyn
21 days ago
I think the output is NULL.
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