<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>HirdWeb &#187; ZCE</title>
	<atom:link href="http://www.hirdweb.com/tag/zce/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.hirdweb.com</link>
	<description>Another Blog clogging up the already crowded internet</description>
	<lastBuildDate>Wed, 18 Jan 2012 20:54:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Zend Certification Practice Exam</title>
		<link>http://www.hirdweb.com/2008/09/26/zend-certification-practice-exam/</link>
		<comments>http://www.hirdweb.com/2008/09/26/zend-certification-practice-exam/#comments</comments>
		<pubDate>Fri, 26 Sep 2008 15:23:50 +0000</pubDate>
		<dc:creator>stephen</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[certification]]></category>
		<category><![CDATA[ZCE]]></category>

		<guid isPermaLink="false">http://www.hirdweb.com/?p=88</guid>
		<description><![CDATA[In preparation for the Zend Certification Exam (ZCE), Zend provides a great (sarcasm) online practice test that consists of 8 questions. That is right, 8 questions. A certification exam that consists of 70 questions and Zend offers 8 questions. And the other thing with the practice test, is that if you get 5 out of [...]]]></description>
			<content:encoded><![CDATA[<p>In preparation for the Zend Certification Exam (ZCE), Zend provides a great (sarcasm) <a href="http://www.zend.com/store/education/certification/self-test.php" target="_new">online practice test</a> that consists of 8 questions. That is right, 8 questions. A certification exam that consists of 70 questions and Zend offers 8 questions. And the other thing with the practice test, is that if you get 5 out of 8 correct, then you are &#8220;ready&#8221; to take the exam. Which I would not suggest, unless of course you have at least 1 year of real PHP experience coding, testing, even hacking. Plus, there is a good amount of DB stuff on the test, as well as security, streams, XML/Web Services and other stuff. I also suggest you pay (that is right, pay) for a set of practice exams. But I digress. Back to the Zend practice test. They give you 8 questions, then just tell you how many you got right/wrong. There is no feedback (like a real exam) on the practice test, which I think there ought to be. So I decided I would not only give you the answer, but why it is the answer. Following is the exam questions and the answers and why they are the answers.<br />
<span id="more-88"></span></p>
<pre>1. How can precisely one byte be read from a file, pointed by $fp?
A) 		fseek($fp, 1)
B) 		fgets($fp, 1)
C) 		fgetss($fp, 1)
D) 		fgetc($fp)
E) 		All of the above </pre>
<ul>
<li>A. fseek($fp,1) will set the position in the file based on the offset, which in this case is &#8220;1&#8243;. This will not read one byte, but rather set the position at a byte specified by the offset, so this answer is not correct.</li>
<li>B. fgets($fp,1) will read one line of the file. So this will obvious get the one byte, but it will get much more than that, so this answer is not correct. </li>
<li>C. fgetss($fp,1) will do the same as above, read the entire line, but it also tries to strip any HTML and PHP tags it finds, so this can not be the correct answer. </li>
<li><b>D. fgetc($fp,1)</b> is the correct answer. This function, think of it as fgetcharacter, (fgetc), which will return 1 byte from the file pointer. There are some instances where this may not be the best (like special characters in UTF-8, but the exam is looking for this answer.</li>
<li>E. is not correct because the other options are not correct. If you see questions like this, and eliminate even 1 possibility, then this is not correct. </li>
</ul>
<pre>2. What object method specifies post-deserialization behavior for an object?
A) 		__sleep()
B) 		__wakeup()
C) 		__set_state()
D) 		__get()
E) 		__autoload() </pre>
<ul>
<li>A. __sleep is the magic function that performs clean up of objects and serializes the variables and returns an array with the names of the variables. This would be an incorrect answer. </li>
<li><b>B. __wakeup</b> is another magic function that will reconstruct the resources that may have been lost, ie reconnect the DB connections. This would be the correct answer as it is what unserialize() checks.  </li>
<li>C. __set_state only is used when classes are exported by var_export(). This is not a correct answer.</li>
<li>D. __get is used with overloading, used to read data from inaccessible members, again, not a correct answer. </li>
<li>E. __autoload would be a customized magic function, and not a correct answer.</li>
</ul>
<pre>3. Where does the session extension store the session data by default?
A) 		SQLite Database
B) 		MySQL Database
C) 		Shared Memory
D) 		File System
E) 		Session Server</pre>
<ul>
<li>A. SQLite &#8211; This is not the default storage for sessions, and usually not the best place to put sessions anyway. This is not a correct answer.</li>
<li>B. MySQL &#8211; Since the question is worded with the key word &#8220;default&#8221;, this can not be correct. A database approach to session storage is good for large traffic sites, but this is not the correct answer.</li>
<li>C. Shared Memory -This is one of those answers thrown in to make it look viable, but obviously it would not share memory with sessions.</li>
<li><b>D. File System</b> PHP&#8217;s default session storage is in the temp (tmp) directory of the system. This is the answer they are looking for.</li>
<li>E. Session Server &#8211; again, like B and C, it is not a correct answer.</li>
</ul>
<pre>4. Which of the following data types cannot be directly manipulated by the client?
A) 		Cookie Data
B) 		Session Data
C) 		Remote IP Address
D) 		User Agent </pre>
<ul>
<li>A. Cookie data is stored on the client and is easily manipulated, so this is not correct.</li>
<li><b>B. Session Data</b> Session data is stored on the server, and therefore would be the correct answer as the client has no direct access to it.</li>
<li>C. Remote IP Address is incorrect as there are a ton of ways to now spoof IPs, including using certain websites like Anonmizer to hide your IP address. </li>
<li>D. User Agent can be forged as easily as cookie and IP addresses. This is not a correct answer. </li>
</ul>
<pre>5. What is the difference between isset() and other is_*() functions (is_alpha(), is_number(), etc.)?
A) 		isset() is a function call and is_*() are not function calls
B) 		is_*() are language constructs and isset() is not a language construct
C) 		isset() is a language construct and is_*() are not language constructs
D) 		is_*() return a value whereas isset() does not </pre>
<ul>
<li>A. isset() is a function, but is_* are also functions, so this is not correct.</li>
<li>B. is_* are language constructs is a false statement, thus making this answer incorrect. </li>
<li><b>C. isset() is a language construct</b> and therefore is the correct answer. It is built into the language and can not be used with variable functions like the other options.</li>
<li>D. is_*() returns a value, but isset() also returns TRUE or FALSE, so this can not be correct.</li>
</ul>
<pre>6. What will be the value of $b after running the following code?
$a = array('c', 'b', 'a');
$b = (array) $a;
A) 		TRUE
B) 		array('c', 'b', 'a')
C) 		array(array('c', 'b', 'a'))
D) 		None of the above </pre>
<ul>
<li>A. TRUE is incorrect as an answer here because what is being done in the example is type casting. This is not a correct response to the question the way it is worded.</li>
<li><b>B. array(&#8216;c&#8217;,'b&#8217;,'a&#8217;)</b> is correct because the variable b is being set to $a and cast as an array.</li>
<li>C. array(array(a,b,c)  is not correct as there is no multidimensional array happening here. So this is incorrect.</li>
<li>D. None of the above would not be correct because B is the right answer.</li>
</ul>
<pre>7. Which of the following function signatures is correct if you want to have classes automatically loaded?
A) 		function autoload($class_name)
B) 		function __autoload($class_name, $file)
C) 		function __autoload($class_name)
D) 		function _autoload($class_name)
E) 		function autoload($class_name, $file) </pre>
<ul>
<li>A. autoload($class_name) would be incorrect because what PHP would be looking for is a &#8220;magic&#8221; function to automatically load a class.</li>
<li>B. __autoload($class_name, $file) would be incorrect as it is looking for a class name, not additional files and parameters.</li>
<li><b>C. __autoload($class_name)</b> is correct because it is the magic function that PHP is looking for, with the class name as the paramater.</li>
<li>D. _autoload is incorrect as magic functions will always have 2 underscores, ie __</li>
<li>E. autoload($class_name, $file) is incorrect much the same reason as answer A.</li>
</ul>
<pre>8. What is the best way to run PHP 4 and PHP 5 side-by-side on the same Apache server?
A) 		Run one as an Apache module, the other as a CGI binary.
B) 		Run both as a CGI binary.
C) 		Just use .php4 for PHP 4, and .php for PHP 5.
D) 		Use .php for both but use different document roots. </pre>
<p>Here is where the great debate can begin. However, in order to understand this answer, you need to understand the question. This question (and exam) are going to be testing your knowledge of PHP and Apache. Could each answer have its own strengths? Yes. What is the best way to run php4 and php5 side by side? My answer would be DON&#8217;T. Upgrade all code to php5, php4 is no longer supported and now &#8220;deceased&#8221;. However in some cases you would not be able to. So looking at the question again, you can break it down thusly:<br />
- The question is about PHP running on Apache<br />
- The question is looking for an answer on the SAME Apache server<br />
- The only viable correct answer in this case is A</p>
<ul>
<li><b>A is the correct answer</b>. This is because the question says you are running PHP on Apache. The other way to run a different version is CGI binary</li>
<li>B. Running both as CGI binary still does not solve the problem, and ignores the point of the question.</li>
<li>C. Using a different extension does not really solve problems for application in php4 that still have extensions of *.php. That would cause overhead and man hours to change extensions</li>
<li>D. While this really would not solve the problem of php4/php5 side by side, it also ignores the real root of the question</li>
</ul>
<p>Now, if you got all 8 questions correct, congratulations! According to Zend, you are ready to take the exam. My advice, study first. Look through the PHP manual, take the real practice exams, get ready for questions like this:</p>
<pre>
How can one take advantage of the time waiting for a lock during a
stream access, to do other tasks using the following locking code as the base:
$retval = flock($fr, LOCK_EX);
a. Use flock_lazy() instead of flock()
b. Use LOCK_EX|LOCK_NB instead of LOCK_EX
c. Use LOCK_UN instead of LOCK_EX
d. Check the value of $retval to see if the lock was obtained
e. Check to see if $retval == LOCK_WAIT
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.hirdweb.com/2008/09/26/zend-certification-practice-exam/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Zend Certification</title>
		<link>http://www.hirdweb.com/2008/09/08/zend-certification/</link>
		<comments>http://www.hirdweb.com/2008/09/08/zend-certification/#comments</comments>
		<pubDate>Mon, 08 Sep 2008 14:27:33 +0000</pubDate>
		<dc:creator>stephen</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[certification]]></category>
		<category><![CDATA[ZCE]]></category>
		<category><![CDATA[Zend]]></category>

		<guid isPermaLink="false">http://www.hirdweb.com/?p=84</guid>
		<description><![CDATA[Another quick post this week, as I am bogged down in work and preparing for a Zend Certification Exam. I am going to be taking the exam for Zend Certified Engineer (ZCE). While I do not expect it to be much problem, these types of exams are usually worded in a way that may not [...]]]></description>
			<content:encoded><![CDATA[<p>Another quick post this week, as I am bogged down in work and preparing for a Zend Certification Exam. I am going to be taking the exam for Zend Certified Engineer (ZCE). While I do not expect it to be much problem, these types of exams are usually worded in a way that may not give you all the basics. </p>
<p>I do highly recommend to visit the Zend site, download the exam prep book, and then also get a 5 pack of the test exams. The <a href="http://www.zend.com/en/store/php-certification/study-guide" target="_blank">Zend store</a> has the book and you can add on the practice exams for $17 (for 5 exams). The book explains the basics on the exam, things like network programming, XML and web services, and other items that will appear on the exam. Then if you get the 5 pack for the exam, you can take a practice test 5 times, and be able to get an idea of what the exam will be like. </p>
<p>Some of the questions seem like no brainers, but then there are times when the question has a key word, that makes the question mean something completely different than first appearances. One of the things I learned a long time ago, is that with these types of exams, the multiple choice has four to five questions that can be peared down quickly. Usually one is not going to be correct because of absurdity, one is going to sound like it is right, but for obvious reasons it is incorrect. Then there are the final 2 questions that can both be correct, but there is one answer they are looking for. </p>
<p>Sounds easy right? Would be if it was just like college, where you get to take a test, if you do not get a &#8220;pass&#8221; grade, then there are other things you can do to make up the score. With these exams, and this one in particular, it is $125 for one certification exam. You do not pass, not only are you out $125,   you do not get anything, no certification of any kind. You need to pay again for another shot at the exam. So no matter how much you know a language, no matter how much you think you may know, always study and prepare. It never hurts and in the process, you may get to know more about the language than you did before. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.hirdweb.com/2008/09/08/zend-certification/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

