Errata for Object-Oriented PHP


Find below a list of errata. If you find an error, please communicate it using the email link in the right sidebar. Please include your return email address.

Page  DescriptionFix

27Semi-colon missing in code listing.Terminate line with ";".
return $this->filearray;
 
33References to checkAllSpecificType in paragraphs 3 and 4.Replace references to the checkAllSpecificType method with references to the filter method.
 
37"private $quality = 100;".Compression for PNG images must be in the range 0 to 9.
 
38First paragraph:
"... the built-in PHP function filesize ..."
Should read:
"...the built-in PHP function getimagesize ..."
 
39See the Note " ... the $path variable ..."Replace $path with $file
 
42The image functions in code listing 6.4 no longer accept an empty string as the second parameter.Use NULL in place of an empty string.
 
43Listing 6-5 and 6-6 and third paragraph:
... only returns a legitimate value if the image is a .jpg or .png.
Remove the words "or .png".
You can only set the quality of a .jpg file. .png files don't support this capability. The download files for this chapter have been corrected. The previous statement is no longer true. As of version 5.1.2 the "quality" parameter is supported for PNG files.
 
43Listing 6-5 is missing a "}".There should be a "}" on a separate line following $quality = 75;.
 
79The code Listing 10-2:
MySQLConnect::$instances = 0;
MySQLConnect::$instances = 1;
Note that this is the assignment not the test for equality that also appears in this code section. Code files also corrected.
 
92There is some discussion of allowing interfaces to have constructors.As of version 5.2, interfaces may indeed have constructors.
 
111The footnote:
There is also a magic method_set_state ...
There is also a magic method, __set_state ...
For more information about this method see the Articles link
 
116Concatenation operator missing in code listing: require $class ".php";Should read:
require $class . ".php";
 
171foo(&$var); and Deprecated appear in the wrong columns.foo(&$var); should appear under the PHP 4 column. Use of call-time pass by reference is deprecated in PHP 5.