About the Author

Chris Shiflett

Hi, I’m Chris: web craftsman, community leader, husband, father, and partner at Fictive Kin.

Preparing for the Zend Certification

In the past week or so, there has been a lot of discussion about preparing for the Zend Certification exam. A common concern people have is whether they can expect to pass it, and this is understandable. Even when you've been developing in PHP for a few years, you may only be familiar with a small subset of PHP's features. Another valid concern is whether the exam asks questions that are tricky or obscure. Some people are worried about missing questions on topics that they understand very well.

For anyone concerned about the presence of obscure questions or the quality of the exam in general, I can tell you that Zend did not create this exam in isolation. They chose an advisory board to establish the target audience, determine the criteria, and write the questions. We all worked together, so poor questions were revised or thrown out before making it to the beta exam. A psychometrician performed a quantitative analysis of the results of the beta exam, and more questions were eliminated as a result of this. Only questions of the highest quality remain, and small improvements not affecting the difficulty of the exam are currently being made. More information about the creation of the exam is available as part of Daniel Kushner's presentation, Attacking the PHP Job Market.

For those wanting to get a small taste of the exam, Zend is offering a self test with 5 practice questions. If you haven't already taken it, go ahead and try it - it only takes a couple of minutes. When you're finished, read below for my comments.

Question 1

What is the value of $a? 

= 123 == 0123;
?> A. True B. False

I think this question is a bit tricky, because it requires you to realize that 0123 is interpreted by PHP to be the octal representation of 83 due to the leading zero (64 + 16 + 3 = 83). Other than this, the question is good in that it requires you to understand how assignments and comparisons work. The answer is B (False).

Question 2

What is the value of $result in the following PHP code? 

function timesTwo($int) {
$int = $int * 2;

$int = 2;
$result = timesTwo($int);

I think this is a very good question. It requires that you understand how functions and return values work. I think any PHP developer wanting to be certified should understand functions very well - return values, passing by reference, passing by value, function local scope, the global keyword, and how all of these things work. In this question, because timesTwo doesn't return anything, the answer is null.

Question 3

The code below __________ because __________. 

class Foo {
function bar() {
?> A. will work, class definitions can be split up into multiple PHP blocks B. will not work, class definitions must be in a single PHP block C. will not work, class definitions must be in a single file but can be in multiple PHP blocks D. will work, class definitions can be split up into multiple files and multiple PHP blocks

This questions requires that you notice the presence of two PHP blocks and recognize that class definitions must be in a single PHP block. My only complaint with this question is that it's difficult for a developer to deduce the answer - it's just something you have to know. On the other hand, the presence of HTML in the middle of a class definition would be an obvious problem, because it makes no sense in this context. I would expect a developer to be able to answer this question correctly, but it might take a few minutes to think about it. The answer is B (will not work, class definitions must be in a single PHP block).

Question 4

When turned on, __________ will __________ your script with different variables from HTML forms and cookies.

A. show_errors, enable
B. show_errors, show
C. register_globals, enhance
D. register_globals, inject

This is not a good question. While the first two answers make no sense, both C and D seem viable, and the difference between the two seems entirely subjective. If you consider register_globals to have a negative connotation, you're more likely to think of its behavior as injecting rather than enhancing. However, I don't think a distaste of register_globals is a necessary characteristic of an expert PHP developer. The answer is D (register_globals, inject).

Question 5

What will be the output of the following PHP code? 

echo count(strlen('http://php.net'));

I like this question. It assumes that you are familiar with the functions count and strlen, but I think this is a safe assumption, and I think it is easy to deduce what these functions do anyway. This question is likely to be missed by the same people who might execute a query that begins with select count(*) and then wonder why mysql_num_rows always returns 1. The answer to this question is 1, because strlen returns a single value - the length of the string.

Hopefully my analysis of Zend's self test gives you a small taste of the types of questions you're likely to encounter on the exam. While I'm just one member of the advisory board, the others tend to share my dislike of obscure questions, and I think the questions that remain are straightforward and well-written.

Zend also has a FAQ available that includes the exam objectives. Use these to direct your studies.

If you're planning on taking the exam, you can save yourself $200 by being the first to solve this puzzle. Zend is offering a free pass to the winner.

About this post

Preparing for the Zend Certification was posted on Tue, 05 Oct 2004. If you liked it, follow me on Twitter or share:


1.Aaron Wormus said:

Nice, thanks for the links.

Question: The NDA in the last chapter of the Guide mentions your Certification expiring or being terminated. Daniel recently said that the certification didn't expire. Under what circumstances can certification be terminated.

Tue, 05 Oct 2004 at 08:35:26 GMT Link

2.Christopher Thompson said:

I don't think these questions are as good as you do.

#1 is probably the best of the 5.

#2 is a red herring.

#3 tests an arcane parser behavior that PHP would flag with an error immediately so it would never cause a program to work improperly.

#4 is by your own admission subjective.

#5 really asks the question: "What do PHP functions that expect an array parameter do when passed a scalar?" The answer is: a bunch of different things so you have to memorize them.

Tue, 05 Oct 2004 at 14:54:33 GMT Link

3.Adam Trachtenberg said:

I think all these questions suck big time, largely because a programmer who used common-sense would have never tried to do any of these stupid things.

1) Most developers don't play with octal, nor should they.

2) If you write this code, it's a bug, so who cares what it actually returns? This is also language dependent. The behavior is totally different in Perl, for example, so I don't know why it's obvious that the answer should be null.

3) PHP lets you split code up inside if/elses, so I don't think you'd again obviously assume you couldn't do it inside classes. Also, I can't imagine anyone ever doing this, so how would you know ahead of time?

4) This is editorial, not technical. register_globals is both a bug and a feature.

5) count() is supposed to be used with arrays. I've never even bothered to pass in a scalar, so it could return 1, or it could return false, or null, or a warning, or whatever. Again, nobody in their right mind would have ever tried this.


Tue, 05 Oct 2004 at 15:59:50 GMT Link

4.Chris Shiflett said:

Aaron writes:

> Question: The NDA in the last chapter of the Guide mentions your Certification

> expiring or being terminated. Daniel recently said that the certification didn't

> expire. Under what circumstances can certification be terminated.

You'd have to ask a lawyer why that phrase is in there, but I bet it's there "just in case." I imagine it would take an extreme event for a certification to be terminated, such as if you admit that you had someone else take the exam for you, somehow bypassing the identity validation at the testing center.

I haven't been involved in any discussion about this, so all I can do is speculate.

Christopher writes:

> #5 really asks the question: "What do PHP functions that expect an array

> parameter do when passed a scalar?"

While it might not make practical sense to count something that only has one value, that doesn't mean that this function expects an array. That's like thinking print_r expects an array, and it's equally wrong.

Adam writes:

> I think all these questions suck big time, largely because a programmer who

> used common-sense would have never tried to do any of these stupid things.

Let me state the obvious by saying that these questions aren't on the exam. My intent is to show you how I would have responded if these were proposed questions, and as you can see, I have complaints about most of them.

While I complain about the octal thing, this is something that very experienced developers will know. I understand the need to have a few questions of a higher caliber to provide a clearer contrast between various skill levels. If this weren't the case, the passing score would need to be close to 100%.

We apparently disagree about question 2, because I think this is a good question. Who cares what happens in Perl? We're testing PHP knowledge.

If people who notice the missing return statement still have trouble coming up with the right answer, then that would be cause for concern, but I don't think that's the case.

It's also important to realize that not all PHP developers have the luxury of writing new code all the time. Some people get jobs where they must maintain existing applications. Both of these scenarios require you to be able to debug problems, so this skill definitely has value. I see no problem in having some questions that test this skill.

I pretty much agree with you about the others, as you can tell, with the exception of question 5. The count function is not an array function, and I think it's fine for people who answer 14 to get this one wrong.

This is a key point, actually. If question 5 somehow made it to the beta exam, and people were frequently missing it with a wide variety of answers ("it could return 1, or it could return false, or null, or a warning, or whatever"), then the psychometrician would identify the problem and have the question thrown out. If a majority of the answers were either 1 or 14, then the question is doing its job. There are many other factors taken into consideration during the quantitative analysis, such as whether those who miss a particular question tend to score high on the exam (which might indicate a problem).

Tue, 05 Oct 2004 at 17:58:11 GMT Link

5.Adam Trachtenberg said:

Well, as far as question #2 goes, I personally have absolutely no idea what a function that doesn't return a value actually returns. It was quite easy for me to notice the mistake, but then I had no idea what the value would have been. I think I actually would have guessed, true, quite frankly, or maybe false. I rarely guess null.

Also, as to #5, if forced to choose an answer, I guess I would have picked 1, or maybe false, because I didn't think count() worked for non-arrays. Heck, count() is even defined in ext/standard/array.c.

All I'm saying is that lots of these questions ask me to produce the answer for something I'd never actually do. At least octal is something real, even if rarely used.

Tue, 05 Oct 2004 at 21:17:25 GMT Link

6.Chris Shiflett said:

Adam writes:

> It was quite easy for me to notice the mistake, but then I had no idea what the

> value would have been.

This is definitely a problem in the question then. While it's easy for me to understand this (because you told me, and I know you), I can only hope that the psychometrician would be able to do a good job of identifying these types of problems when analyzing the results of the beta.

The target wrong answer is 4. If there are a wide variety of other answers, then the problem is easy to spot. The answers should be dominated by the target wrong answer and the correct answer. I am confident that everyone who answers 4 deserves to miss this question.

How would we fix it? I'm not sure, but one possibility would be to make it a multiple choice. Given answers of 4, 2, parse error, or null, I think it would be easier to get the right answer for those who notice the missing return. A follow-up analysis would hopefully determine whether this fixed the problem.

I see your point about question 5. Again, there is a target wrong answer (14) and a right answer (1). If these don't make up a significant majority of the total answers on the exam, then the question needs to be reworked.

This method certainly isn't foolproof, but it seems pretty good to me. For example, I thought question 5 was a good question after reading it. However, the analysis of the beta could have revealed a problem if there seemed to be a large collection of the target wrong answer (14) but no clear majority of the remaining answers.

Tue, 05 Oct 2004 at 21:34:26 GMT Link

7.Chrsitopher Thompson said:

I agree with Adam and have a couple of thoughts on this.

First I think that people will take the sample test at zend.com and justifiably think -- why should I take this test. It has no proven value and they are making it arcane so you have to take it a bunch of times so they can make more money.

Second, it brings out the problems with PHP (which may be a good thing). For example, the documentation for count() says, "Returns the number of elements in var, which is typically an array (since anything else will have one element)." What's an element? Well it is part of an array. But in this case it means that non-array types are considered as array with one element. Yet you still say, "The count function is not an array function" which is as silly as the documentaton. Returning 1 for everything but arrays does not suddenly make you not a real mixed var function. Given the count() logic, each{$mystring) should return the string value in $mystring.

The return value of a function with no return statement is not documented that I can find. It should return undefined, but now we know that it returns null. Since you can do a return(null); it makes it impossible to tell if a function has no return statement. And I am no better PHP programmer for knowing any of the above.

Tue, 05 Oct 2004 at 21:55:43 GMT Link

8.Alan Knowles said:

Alot of them as mentioned seem like they are testing the candidates knowledge of the parser/compiler.

It may have been more realistic to search the bugs database for things that people actually do.


class {

include 'somemethods.php';



(look at bogus/wont fix)

I guess it's difficult to get an overview of the whole thing from a few questions, but it would be better to be asking things like

check the pros/cons for each code style:


$obj->somevar = ...

focus on spotting coder's habit's for writing java in php.. etc.

Wed, 06 Oct 2004 at 00:19:16 GMT Link

9.Paul Reinheimer said:

I had the opportunity to take the test at PHP|Works, and there are definetly a few questions on there that I felt were either poorly worded (so as to leave multiple interpretations), or unduly arcane. I had the opportunity to raise these issues with Daniel (who administered the test) who assured me that several of these questions had undergone revision, and would be updated shortly when the test was updated.

And hey, the test can't be all bad, afterall I passed! :)

Wed, 06 Oct 2004 at 00:55:33 GMT Link

10.Christopher Thompson said:

"focus on spotting coder's habit's for writing java in php"

Now that would be a useful test!

Wed, 06 Oct 2004 at 03:26:34 GMT Link

11.Bernhard Fürst said:

I agree completely with Adam's and others points about the kind of questions. They are partly not answerable with my common sense as PHP programmer.

I want to add: usually I don't have every PHP function and its parameters inside my head. I have it inside my computer and usually I know what I'm looking for. But don't know if it is called strrpos(= or str_pos() or something like that. One look into the manual will tell me. That's enough I think especially in this times of information flooding.

Because of this the questions which need the exact knowledge of parameters or function names make me fear I have to learn all this things by heart to be well prepared for the Zend certification. E.g. see chapter "Practice Exam Questions" #14 or #17 in the "ZEND PHP Certification Study Guide".

Wed, 06 Oct 2004 at 12:30:50 GMT Link

12.Bernhard Fuerst said:

BTW: Umlaut "ue" in my name above is not &Atilde;&frac14; in HTML but &uuml;

Your blogging software failed my german Umlaute certificate ;)

Wed, 06 Oct 2004 at 12:33:57 GMT Link

13.Todd Patrick said:

Wasn't the Zend PHP Certification Study Guide was meant to help you take the Zend PHP Certification exam, therefore it should be error free.

There really is no execuses for having errors in a study guide that is only 239 pages. Plain and simple...

On phparch.com; I have read through various threads and errors have been placed on the blame of software or SAMS or whatever...

I'm tired of it, PHP developers don't want excuses, especially when studying for an exam that costs $200.00 that comes out of the developer's own pocket a majority of the time.

It is absolutely unacceptable.

Thus, no more excuses from this point forward.

1. Will the errata for the first addition of the Zend PHP Certification Study Guide keep it inline with the second release?

2. Are there any new suprises, such as new content in the second release? Or does the second release just contain the corrections?

Again, a lot of PHP developers who want to take the Zend PHP Certification Exam have to pay for it out of their own pocket and can't neccessary afford the online class either. Thus, the most accessible way to study is the Zend PHP Certification Study Guide and it needs to be error free.

Please. No more execues.

Thu, 02 Dec 2004 at 18:19:35 GMT Link

14.Chris Shiflett said:

Bernhard Fürst wrote:

> Your blogging software failed my german Umlaute certificate ;)

You're right. Sorry about that.

Things are fixed now. Can I retake the exam? :-)

Sat, 26 Mar 2005 at 04:49:44 GMT Link

15.webKami said:

I remember my C-Language exam in good old days, we had a teacher who was famous for creating torturing questions out of never-commonly-used code snipplets, and you have no need ever to use these.

e.g printf("%d",printf("%02f",2765/23));

who cares what printf returns, as long as it prints the output in Real Life programming.

Questions 1, 2, 3, 4 are these kind of questions

These question are confusing too, as there is no sense in trying these stupid things.

Most of times I try this kind of stuff, just for curiosity... Which makes me think I can pass easily if questions are this much nonsense. :D

Last question have 2 answers, depends on what was your last experience with register_globals. good or bad

Fri, 08 Apr 2005 at 11:18:17 GMT Link

16.Mick Sear said:

When I took this practice exam, there were 6-7 questions, not 5. What about some discussion of the other questions?

Mon, 11 Apr 2005 at 12:53:01 GMT Link

17.Chris Shiflett said:

I posted the answers to the new test here:


Mon, 11 Apr 2005 at 14:09:48 GMT Link

18.Chris Shiflett said:

I blogged about the new test here:


Sun, 06 Nov 2005 at 04:53:34 GMT Link

Hello! What’s your name?

Want to comment? Please connect with Twitter to join the discussion.