PHP Certification Exam - Which function is incorrect?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
phpcat
Forum Newbie
Posts: 8
Joined: Thu May 28, 2009 11:23 pm

PHP Certification Exam - Which function is incorrect?

Post by phpcat »

Code: Select all

Which of the following is incorrect?
 
Answers: (choose 4)
 
a) function c(MyClass $a = new MyClass())
b) function d($a = null)
c) function e(&$a = 30)
d) function a(&$a = array(10,20,30))
e) function b($a = (10 + 2))
According to the exam, four are wrong and one is right. It seems that A and E are definitely wrong. But B, C, and D don't give any errors. Can anyone shed some light on this?
User avatar
McInfo
DevNet Resident
Posts: 1532
Joined: Wed Apr 01, 2009 1:31 pm

Re: PHP Certification Exam - Which function is incorrect?

Post by McInfo »

The question is antiquated. It applies to PHP 4 and earlier versions.
PHP Manual wrote:As of PHP 5, default values may be passed by reference.
PHP Manual: Function arguments

Edit: This post was recovered from search engine cache.
Last edited by McInfo on Tue Jun 15, 2010 4:43 pm, edited 1 time in total.
phpcat
Forum Newbie
Posts: 8
Joined: Thu May 28, 2009 11:23 pm

Re: PHP Certification Exam - Which function is incorrect?

Post by phpcat »

This is a mock test for the PHP 5 certification that you can order from Zend.com. It appears they made a mistake on this question. So, the only incorrect answers are A and E, right?
User avatar
McInfo
DevNet Resident
Posts: 1532
Joined: Wed Apr 01, 2009 1:31 pm

Re: PHP Certification Exam - Which function is incorrect?

Post by McInfo »

There is no right answer. The key does not match the lock.

Edit: This post was recovered from search engine cache.
Post Reply