PHP in a Nutshell (In a Nutshell (O'Reilly))
Good book, I bought it used and you can see it is but it's in average to good condition.
I'd buy from these people again.
A must have for the webmster
It's not only a quite good reference book, but for the people with a good programming skill it's actually anything you need to learn PHP.
Definitely a must in the bookshelf of everybody involved in working with the WWW. from webmasters to developers and support workers, but also for the geek who just enjoys playing with a programming language like this.
Poor. Lack or attention to detail (See list of errors, and decide for yourself)
Regarding the Oct 2005 - First edition. I sure hope O'Reilly hires a better proof-reader, and re-issues this book with some basic corrections, and 100% more attention to the index problems.
I think the author did a poor job. A dedicated proofreader should have caught all the errors I have listed. I am only 20% through this book. At this point, this author has built zero confidence in the accuracy of anything he has to present in the rest of the book. I will now proceed to prove where my 'poor' evaluation comes from.
(My background: 25 years of programming, including skills with various machine languages,
assembly languages, Fortran, Pascal, PL/1, C, C++, Java, PHP, and Regular Expressions. )
Stated by the author: "This book assumes you are familiar with variables, lops, and other basic programming concepts [period]." This is incorrect, as other reviewers have noted. The author quickly drifts into examples of arrays, objects, advanced operators, etc. with no explanation, or even a reference to the section of the book that covers these new concepts.
Starting with "The PHP Language" section, I am finding an error or obvious omission, on an average of every three pages. This book has been poorly proof-read, and should not have made it past the publisher in this form. I expect far more accurate text that this, for an O'Reilly publication.
As for the six people whom the author lists as standing out particularly,
with regards to contributing corrections, improvements, and comments . . . I couldn't imagine how bad this work would be without their efforts.
Page 32: Using complex data forms and concepts in examples, without providing page references.
Here, arrays are introduced. Would it be so hard to add a footnote
"See the extensive Arrays section, starting on page 61."?
page 32: Same comment, applied to 'Objects'
Page 32: Same comment, applied to the '->' object operator.
( Page 132: "use the special -> operator". Other PHP documentation calls this the 'object operator', but this author does not use this literal phrase. There is also no index entry for this phrase, or any reference to it under 'operator' or 'object'. )
Page 42: 'Returning by Reference'. This obscure concept really needs an explanation of what is happening in the 5-line example. According to the 'Variable Scope' explanation (ten pages later),
the variable in this function is local, and is therefore not reference-able outside the function.
Yet the description of "Returning by Reference' indicate that the value of the variable is accessible.
Page 45: Introducing the capability of the GLOBALS array, with no caveats, for the purpose of overriding
scope. Ten pages later, in a different topic (Superglobals), we find the warning: "two superglobals that you should avoid ... $GLOBALS...". The warning should be on page 45, where you first start describing this superglobal. Again, has this author never heard of the literary construct called a footnote?
Page 51: In an example, '(int)' is used to typecast a bool into an integer. At the top of the next page, the typecast operation is written in another example as '(integer)'. If both syntaxes are supported, this sure would be a good place to note that.
Page 64: In the example, function_load_member. A $ID parameter is passed, but not used. Probably the "Bob" literal should be $ID.
Page 64: Same code example as above. This two line function has one assignment, and one return statement ('return true;'). The calling code evaluates the completion of this function as if there are multiple
methods of return; i.e. true or false. The text ahead of his example loosely implies that if the function was not 'successful' (whatever that means), the returned boolean will be 'false'.
Page 66: Array_intersect() with multiple arrays parameters. There is no indication if this is an AND or an OR operation, with multiple secondary arrays. That is, will an array1 entry be returned if it is in array2 *OR* array3, or must it be in array2 *AND* array3?
- - -
One thing the author did get correct is in his list of web-sites. The TOP entry is www.php.net/manual , and it consistently clears up the errors the author makes. I recommend it.
Not a Nutshell Book
The O'Reilly "in a Nuthsell" series is the best reference to standard libraries and language features available. PHP in a Nutshell sullies the name, however, with what amounts to an introductory survey in the course and little, if any, analysis of standard libraries. Certain tips, such as those on flash and pdf handling are interesting, but irrelevant to most programmers. This goes doubly for the discussion of PHP's 2D drawing API; it seems as though the authors decided they would provide a schizophrenic volume which is on the one hand a beginner's tutorial and on the other hand a survey of the more esoteric, unused portions of the language.
Good review material but many errors
I am pretty familiar with PHP and worked with it some time ago, but I needed a book to quickly refresh my knowledge of it for a project, and this book did a pretty good job of that. It gets to the point on the right topics (including chapters on OOP, Cookies and Sessions, and Databases) and has a short, useful function reference instead of listing every function under the sun.
Nonetheless, there are many errors both in the code and in the writing. If you don't have a solid foundation in PHP and programming, these errors can really throw you off. Sometimes I would get confused as I tried to figure out why a line of code does what the author says it does only to realize it was an error that made it into print. If the editing had been better and caught these errors, the book would have received a four-star rating from me.
Bottom line, if you know PHP and need a good reference book or a book to quickly review concepts and functions, this book is for you. Don't buy this book if you are new to PHP.