Oakland.pm

Reviews

Review of "PHP Pocket Reference"

author: Rasmus Lerdorf

reviewer: George Woolley


PHP Pocket Reference, Second Edition
By Rasmus Lerdorf
Second Edition November 2002
Series: Pocket References
ISBN: 0-596-00402-8
144 pages, $9.95 US, $14.95 CA, £6.95 UK

Note:

Short Review

Rating: :) :) :) :) of 5

This is a very good small concise reference to PHP 4. Most of the book consists of a summary of the basics of the PHP language plus a function reference to about 1400 PHP functions. If you are in need of a handy reference to PHP 4, this pocket reference would be an excellent companion for "Programming PHP" (which is a fuller reference to PHP and is also published by O'Reilly).

I would not get this pocket reference unless you are already somewhat familiar with PHP and already own "Programming PHP" (or rough equivalent). This book, though well written, is not designed as an introduction to PHP. Oh, and you need to be OK with it not covering PHP 5.

If you want more detail, you could take a look at my somewhat longer review.

George of Oakland.pm and Camelot.pm

Miscellaneous

Section Titles

  • Introduction (1/2)
  • Installation and Configuration (2 1/2)
  • Embedding PHP in HTML (3)
  • Language Syntax (1)
  • Variables (2)
  • Data Types (6)
  • Expressions (1/2)
  • Operators (1/2)
  • Control Structures (4)
  • Functions (3)
  • Web-Related Variables (2)
  • Sessions (2)
  • Examples (6)
  • Function Reference (99)

Notes:

  • To view the full table of contents, visit the O'Reilly catalog entry for it.
  • The number in parentheses is roughly the number of pages in the section.

Safari Watch

This book is on Safari Technical Books Online.

Somewhat Longer Review

Contents

Note:

What's PHP?

PHP stands for PHP: Hypertext Preprocessor. ;-)

PHP

  • is a programming language
  • is open source
  • is easy to learn
  • is easy to read
  • runs on the server side
  • can be embedded in web pages
  • makes creating maintainable web pages much easier

There have been several versions of PHP. The versions you definitely need to be aware of are PHP 4 and PHP 5.

PHP 4: PHP 4

  • was first released May 2000.
  • is installed on many servers.
  • is stable.

PHP 5: PHP 5

  • was first released July 2004.
  • has many improvements, most notably an improved object model and some new OO features.

Notes:

  • This review draws on my review of "Programming PHP" where practical.
  • E.g. this section is a shortened version of a similar section in my review of "Programming PHP".
  • If you aren't already familiar with PHP, it probably doesn't make sense to get this Pocket Reference.

About the Reviewer

Languages: I've made significant use of over 20 different computer languages. Not surprisingly, I'm good at learning computer languages.

O'Reilly: I own many O'Reilly books. I am generally quite satisfied with them. I'm a fan of O'Reilly.

Perl: I've been using Perl since 1994. My favorite language by far is Perl. Over the years, I've written a number of Perl CGIs.

PHP: I've only recently started to use PHP and have only used it a little. My ISP does provide me with PHP 4 and it is now enabled for my domain. I own "Programming PHP"; I've read it and reviewed it.

Webmaster: I've developed a number of websites and am currently the webmaster of several non-profit sites. I am definitely not a professional webmaster.

What Did I Expect?

Title: The title is "PHP Pocket Reference" so I expected this book would

  • be small, concise
  • be focussed on PHP
  • contain info on the syntax an experienced programmer would want
  • be a useful reference for a competent user

Cover: There are other things on the cover besides the title.

Based on the words "Creating Dynamic Web Pages", I figured there would be more in this book than just syntax and that the choice of material would reflect these words.

I haven't seen the first edition of this reference, so I didn't have comparative expectations. However, based on the words "Second Edition", I did expect that this book wouldn't have serious flaws, since they presumably would be eliminated by now.

Based on the words "Covers PHP 4", I expected this reference would cover PHP 4 and that it would not cover PHP 5.

Online Catalog Entry: As of 2005-06-20, the online catalog entry said a couple of things that were relevant to expectations.

Based on the words "PHP 4, the language's latest version", I might have concluded that PHP 4 is the latest version of the language. However, I did not because I was quite aware of PHP 5.

I made note of the words "It is both a handy introduction to PHP syntax and structure," but was uncertain what to read into them. These words do not imply, nor did I expect, that this book could serve as an introduction to PHP.

What Did I Get?

The general idea is that I got a small, concise reference for PHP 4.

Parts: The book includes

  • PHP Language Basics
  • Function Reference
  • Other Stuff

There actually is a section called Function Reference. There are no actual Parts or Sections entitled PHP Language Basics or Other Stuff; those are my names.

PHP Language Basics: What I refer to as PHP Language Basics includes sections on

  • Embedding PHP in HTML
  • Language Syntax
  • Variables
  • Data Types
  • Expressions
  • Operators
  • Control Structures
  • Functions

Function Reference: The function reference contains around 1400 entries.

The entry for each function includes

  • return type
  • name of function
  • expected arguments and their types
  • a one sentence explanation of what the function does
  • the version of PHP the function first appears in.

That's all there is in an entry.

Other Stuff: By Other Stuff here, I mean the two sections at the start

  • Introduction
  • Installation and Configuration

and two later specifically web-related sections

  • Web Related Variables
  • Sessions

What I Didn't Get: PHP 4 isn't the latest version of PHP. So I didn't get a reference for the latest version of PHP as implied by the online catalog of 2005-06-20.

What Did I Especially Like?

Language Basics: I found this part of the reference to be quite useful. It was especially useful for reviewing what I had learned from reading a longer reference, "Programming PHP".

Some of the things I benefitted from reviewing were

  • comments
  • different ways of identifying PHP code
  • the alternative form of control structures (which is sometimes used when there are large blocks of HTML within PHP statements)

Of course, these will likely not be the things you need to review.

Function Reference: The Spartan entries for each function (see earlier for what's included) work for me. If I need examples, etc., I'm OK with looking elsewhere. I vastly prefer having the entries as they are. One of the advantages is that I can more easily get a sense of the range of functions. Another advantage is that it helps keep the book small while still allowing a large number of functions.

Gripes

Introduction: I think the introduction could be stronger. For example, the intro refers twice to "the web problem", but doesn't say what it means by that. It wasn't clear to me.

Function Reference: As indicated in the previous section, the Spartan entries for each function work for me. But I gather from reading other reviews some people found the entries inadequate for their purposes. I guess it depends on the individual.

Latest Version: When I looked at it in June 2005, the O'Reilly on-line catalog for this book referred to PHP 4 as the latest version of PHP. Doubtless that was true when the book was published in 2002, but it's not true today.

Who's the Book for?

For: I would say the book would be best for someone who

  • either has already used PHP a moderate amount or is an experienced programmer
  • and has a basic knowledge of the web and of HTML and it's use.
  • owns "Programming PHP" or some similar detailed reference.

Not For: Some good reasons for not getting this pocket reference are

  • You want an introduction.
  • You want something that covers PHP 5.
  • You don't yet have a more detailed reference.
  • The function reference entries are not complete enough for you.

Final Thoughts

This is a really good small concise reference to PHP 4. It covers mainly PHP language basics and a large number of PHP functions.

If that's what you want, go for it.

Completed: 2005-06-24