Programming Books C Java PHP Python Learn more Browse Programming Books
Have one to sell? Sell on Amazon
Flip to back Flip to front
Listen Playing... Paused   You're listening to a sample of the Audible audio edition.
Learn more
See all 2 images

Object-Oriented PHP: Concepts, Techniques, and Code Paperback – June 20, 2006


Amazon Price New from Used from
Paperback
"Please retry"
$8.76 $0.10

NO_CONTENT_IN_FEATURE

Shop the New Digital Design Bookstore
Check out the Digital Design Bookstore, a new hub for photographers, art directors, illustrators, web developers, and other creative individuals to find highly rated and highly relevant career resources. Shop books on web development and graphic design, or check out blog posts by authors and thought-leaders in the design industry. Shop now

Product Details

  • Paperback: 216 pages
  • Publisher: No Starch Press; 1 edition (June 20, 2006)
  • Language: English
  • ISBN-10: 1593270771
  • ISBN-13: 978-1593270773
  • Product Dimensions: 9.2 x 6.9 x 0.7 inches
  • Shipping Weight: 14.4 ounces
  • Average Customer Review: 3.9 out of 5 stars  See all reviews (18 customer reviews)
  • Amazon Best Sellers Rank: #1,099,486 in Books (See Top 100 in Books)

Editorial Reviews

Review

"An interesting and challenging book . . . Lavin has focused on a highly useful area of knowledge for web developers and has done an excellent job. Recommended." -- Kickstart News, August 2006

"Lavin's approach makes this book very easy to read . . . a useful book to add to your library." -- Linux Security, June 16, 2006

From the Back Cover

It can be tough to learn the concepts of object-oriented programming with a language like C++. Fortunately, PHP's simple object model makes it an ideal language for learning about object-oriented programming.

For the uninitiated, this guide to the latest version of PHP offers a speedy introduction to object-oriented programming, including a thorough explanation of classes as well as coverage of constructors, destructors, inheritance, polymorphism, and interfaces. You’ll learn to:
• Promote code reuse by creating your own classes and using built-in classes
• Customize and improve classes through inheritance
• Simplify database access by developing MySQL database and result set classes
• Incorporate an RSS reader into your site using only four lines of code
• Use XML easily with an object-oriented approach
• Employ PHP to autogenerate documentation for your code
• Make thumbnail images on the fly
• Replace clumsy error trapping with exception handling
• Take full advantage of advanced OO features in PHP
• Incorporate AJAX into your OO PHP code

Object-Oriented PHP will show you how to maximize PHP’s features, with much less work than you might think. With Object-Oriented PHP, you can master the basics of object-oriented programming and get up to speed on PHP in one fell swoop.


More About the Author

Discover books, learn about writers, read author blogs, and more.

Customer Reviews

3.9 out of 5 stars
5 star
8
4 star
2
3 star
6
2 star
2
1 star
0
See all 18 customer reviews
This book is great whether you are an experienced coder or a beginner.
Michael F. Mackintosh II
If you are not a PHP developer, you probably should learn some PHP syntax as this book seems to assume that you know some PHP.
Samuel B. Lopez
A little deeper digging reveals that in fact, reference was made in one of the introductory chapters, ch.
Ted Spradley

Most Helpful Customer Reviews

49 of 50 people found the following review helpful By Michael Ernest on August 27, 2006
Format: Paperback
Object-Oriented PHP is really a technical brief that seems to fall short of its own ambitions. It covers PHP 5, most notably the radical switch from prior versions to a full OOP model. Lavin summarizes the reasons for the changes and reviews basic concepts of OOP. He then develops some classes for an application that draws images from a database and displays thumbnail images. In some places the PHP 4 equivalent code is provided for study. Notes on MySQL and PHP Data Objects (PDO) are also included.

It is a terse and sometimes bumpy ride. The book's conversational tone is appropriate for fellow geeks, but I found it more distracting than reassuring. There are some summary apologies, for example, that make the chapters seem like they were transcribed from tape. Rather than go back and match the introductory objectives to the text, a summary or two admits things didn't quite work out as planned. Ok, let's say there was no time to fix it. How does calling attention to it help?

Because the book is so short, the author glosses many concepts, frequently referring to web sites for technical details and tutorials. Once or twice he refers to a well-known author (e.g., Bruce Eckel) to support a complex point. Again while this is appropriate for a peer audience, it also needlessly puts the book out of reach for some readers.

It seems to me the book once had a too-ambitious outline. The back cover states you'll learn to "Incorporate AJAX into your OO PHP code." The coverage on this topic is trivial: an eight-line paragraph that names a website from which to retrieve example code, followed by indicators in subsequent to show where the AJAX reference is. The reader would be right to feel misled.

This book should be useful to the author's PHP peers, but those same readers should understand OOP well beforehand. I doubt a skeptical or demanding reader will like this book. Beginners will almost certainly get lost early and often.
Comment Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback. If this review is inappropriate, please let us know.
Sorry, we failed to record your vote. Please try again
15 of 15 people found the following review helpful By John R. Cornell II on December 31, 2007
Format: Paperback
From the perspective of a an experienced procedural PHP programmer learning OO, having read both this book and "PHP 5 Objects, Patterns, and Practice" by Matt Zandstra, I would definately recommend the latter to this book.

Just because Zandstra's book doesn't have a cartoon on the front, doesn't make it less accessible. In fact I found it both more advanced and easier to understand at the same time. I imagine Lavin writing this book one chapter at a time, writing each successive chapter based on what he forgot in the previous. Zandstra's order of explanation on the other hand I found invaluable and thoughtful. When you're trying to make sense of a system by reading about it in a linear (book) explanation, the order in which the information is introduced and its context is very important.

Zandstra's book is also more thorough, and seems to approach implementation from an enterprise (read proper) perspective.

Lavin spends a lot of time on an example of using OO to build a system to display images in a directory. In hindsight, it turns out the design of his code is flawed in some places. Introduction material is no place to be teaching bad habits of any kind.

This book is $10 cheaper than Objects, Patterns, and Practice, but I think if you're serious about learning OO in PHP the extra $10 is worth it for a higher quality book.
Comment Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback. If this review is inappropriate, please let us know.
Sorry, we failed to record your vote. Please try again
13 of 16 people found the following review helpful By Diane Cipollo on July 21, 2006
Format: Paperback
Object-Oriented PHP by Peter Lavin is a good book for any traditional/procedural PHP programmer who would like to know what those object-oriented PHP programmers are so excited about. If you are considering adding object-oriented PHP to your toolbox and want a step-by-step, example based guide for the beginner, this is a good book to start with. This book is also for programmers who want to switch from PHP 4 to PHP 5.

Lavin starts with an overview of object-oriented PHP and discusses several of its advantages. He then discusses the basics of object-oriented programming such as classes and inheritance and the specifics for this type of programming in PHP. Next, he teaches you how to write your first class. One of the nice things about this book is that the author starts with this simple example and, as you progress through the book, shows how to build upon, extend and reuse that simple class to do more advanced programming.

The first step is to extend this class into a directory item class that will list all the files in a directory or list just certain files as needed. Next, you will write a thumbnail class that will create thumbnail images on-the-fly that are reduce in dimensions and quality thus reducing the download time. The third class you write is a page navigation class, similar to that used by Google, that will control the number of items listed on a page and also the number of page links in the navigation. Finally, he shows you how these three classes work together and with CSS.

Next, Lavin discusses the MySQL database class and how it works with the MySQL database. He also covers inheritance and how that can be applied to simplify error handling.
Read more ›
Comment Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback. If this review is inappropriate, please let us know.
Sorry, we failed to record your vote. Please try again
3 of 3 people found the following review helpful By D. Billeci on August 24, 2007
Format: Paperback
I consider myself an advanced PHP user, I have read a few other PHP books, but I'm always looking to learn something new in the field. This book definitely is for beginners. Up to chapter 9 and so far we've learned not much except how to resize an image and handle multi-page navigation. Chapter 10 (out of 16) deals for the first time with static variables and connecting to a database. There is a brief section on patterns which covers 1 (yes one) pattern, the singleton. Anyways, this book is not bad, it's well written just don't expect to learn much new if you are a seasoned PHP programmer.

I would recommend "PHP 5 Objects, Patterns And Practice", Zandstra, if you are looking for advanced coding techniques.
Comment Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback. If this review is inappropriate, please let us know.
Sorry, we failed to record your vote. Please try again

Customer Images

Most Recent Customer Reviews

Search

What Other Items Do Customers Buy After Viewing This Item?