PHP ZCE mock test, interview preparation, daily lessons under chalk talk

Thursday, January 12, 2012

ZCE Zend Certified Engineer type hinting problem

View the Complete Blog on ZCE

What is the best way to ensure that a user-defined function is always passed an object as its single parameter?



1. 
2. function myfunciton($a = stdClass)
3. Use is_object() within the function
4. There is no way to ensure the parameter will be an object
5. function myfunction(Object $a)


Answer: 1.

No comments:

Post a Comment