If you're using PHP 4, then chances are good that an upgrade to PHP 5 is in your future. The more you've heard about the exciting new features in PHP 5, the sooner that upgrade is probably going to be. Although an in-depth, soup-to-nuts reference guide to the language is good to have on hand, it's not the book an experienced PHP programmer needs to get started with the latest release. What you need is a lean and focused guide that answers your most pressing questions: what's new with the technology, what's different, and how do I make the best use of it? In other words, you need a copy of Upgrading to PHP 5.This book is targeted toward PHP developers who are already familiar with PHP 4. Rather than serve as a definitive guide to the entire language, the book zeroes in on PHP 5's new features, and covers these features definitively. You'll find a concise appraisal of the differences between PHP 4 and PHP 5, a detailed look at what's new in this latest version, and you'll see how PHP 5 improves on PHP 4 code. See PHP 4 and PHP 5 code side-by-side, to learn how the new features make it easier to solve common PHP problems. Each new feature is shown in code, helping you understand why it's there, when to use it, and how it's better than PHP 4. Short, sample programs are included throughout the book.Topics covered in Upgrading to PHP 5 include:
The new set of robust object-oriented programming features
An improved MySQL extension, supporting MySQL 4.1, prepared statements, and bound parameters
Completely rewritten support for XML: DOM, XSLT, SAX, and SimpleXML
Easy web services with SOAP
SQLite, an embedded database library bundled with PHP 5
Cleaner error handling with exceptions
Other new language features, such as iterators, streams, and more.
Upgrading to PHP 5 won't make you wade through information you've covered before. Written by Adam Trachtenberg, coauthor of the popular PHP Cookbook, this book will take you straight into the heart of all that's new in PHP 5. By the time you've finished, you'll know PHP 5 in practice as well as in theory.
Chapter 1 Introduction
Why PHP 5?
What’s New in PHP 5?
Installing and Configuring PHP 5
Chapter 2 Object-Oriented Programming
What Is Object-Oriented Programming?
Chapter 3 MySQL
Installing and Configuring
Before and After: Connecting to the Database Server
Before and After: Querying and Retrieving Data with Prepared Statements
Before and After: Subselects
Before and After: Making Multiple Queries
Securing Connections with SSL
Porting Code and Migrating Databases
Chapter 4 SQLite
Alternate SQLite Result Types
Indexes, Error Handling, and In-Memory Tables
Chapter 5 XML
XML Extensions in PHP 5
Installing XML and XSLT Support
Converting Between SimpleXML and DOM Objects
Before and After: Reading XML into a Tree
Before and After: Searching XML with XPath
Reading XML as Events with SAX
Before and After: Creating New XML Documents
Before and After: Transforming XML with XSLT
Validating Against a Schema
Chapter 6 Iterators and SPL
Before and After: Using Iterators
Implementing the Iterator Interface
MySQL Query Iterator
Before and After: Recursive Directory Iteration
Implementing the RecursiveIterator Interface
Array and Object Property Iteration
Redefining Class Iteration
Iterator and SPL Classes and Interfaces
Chapter 7 Error Handling and Debugging
Before and After: Handling Errors
The Benefits of Exceptions
The Exception Class
Setting a Custom Exception Handler
Processing Errors with a Custom Handler
Chapter 8 Streams, Wrappers, and Filters
Using the Streams API
Chapter 9 Other Extensions
Chapter 10 PHP 5 in Action
Defining Your Database Schema
The Person Class
The addressBook Class
The Template Class
Assembling the Application
Wrap-Up and Future Directions
Appendix Introduction to XML
Comparing HTML and XML
Appendix Additional New Features and Minor Changes
Adam Trachtenberg has an MBA from Columbia Business School. At business school, he focused on general management and operations, with an emphasis on the field of technology. Adam also has a BA from Columbia University. As an undergraduate, he majored in mathematics and his other studies included computer science and Chinese. Before returning to school, he co-founded and served as Vice President for Development at two companies, Student.Com and TVGrid.Com. At both firms, he led the front- and middle-end web site design and development, worked on corporate planning and strategy, and served as liaison between the product and marketing teams. During study breaks, Adam enjoys playing squash, reading fiction, and eating in New York City's many wonderful restaurants. He wishes he was a better at playing pool, knew the constellations, and was handy around the house.
Our look is the result of reader comments, our own experimentation, and feedback from distribution channels. Distinctive covers complement our distinctive approach to technical topics, breathing personality and life into potentially dry subjects. The animals on the cover of Upgrading to PHP 5 are Galapagos tortoises (Geochelone elephantopus). These giant tortoises, native to the Galapagos Islands, are the largest in the world. They can weigh up to 500 pounds and measure up to 6 feet from head to tail. As their bulk suggests, they are slowmoving animals, with a top speed of 0.16 mph. Their plodding pace applies to more than just their gait--they can live for 200 years and take 20 to 25 years to reach full maturity. Baby tortoises spend a full month digging out of their sandy nests after they hatch.Galapagos tortoises are herbivores, and their strong, curved mouths allow them to eat the spiny vegetation found on the more arid islands in the Galapagos chain. Their slow metabolism allows them to survive for long periods of time without food or water, which is necessary during the dry season. Their scaly feet help them navigate the islands' rough lava terrain.Fifteen subspecies of Geochelone elephantopus have been found in the Galapagos Islands, an archipelago located about 600 miles off the coast of Ecuador. The different subspecies are identified primarily by their shell morphology: saddle-back and domed shells are the two general types, but there are intermediate variations. The subspecies descend from a common ancestor, but developed their unique characteristics in response to the varied terrain, available food, humidity, and other environmental factors found on the islands. Charles Darwin's observations of Galapagos tortoises and how they adapted to their environments helped him formulate his theory of natural selection.Galapagos tortoises are endangered, and several subspecies are already extinct. Before whalers, seal fur hunters, and colonists arrived in the 18th century, about 250,000 tortoises lived on the islands. Today, only 15,000 remain. Genevieve d'Entremont was the production editor and copyeditor for Upgrading to PHP 5. Sada Preisch proofread the book. Sarah Sherman and Claire Cloutier provided quality control. Angela Howard wrote the index. Ellie Volckhausen designed the cover of this book, based on a series design by Edie Freedman. The cover image is a 19th-century engraving from the Dover Pictorial Archive. Emma Colby produced the cover layout with QuarkXPress 4.1 using Adobe's ITC Garamond font.Melanie Wang designed the interior layout, based on a series design by David Futato. This book was converted by Joe Wizda to FrameMaker 5.5.6 with a format conversion tool created by Erik Ray, Jason McIntosh, Neil Walls, and Mike Sierra that uses Perl and XML technologies. The text font is Linotype Birka; the heading font is Adobe Myriad Condensed; and the code font is LucasFont's TheSans Mono Condensed. The illustrations that appear in the book were produced by Robert Romano and Jessamyn Read using Macromedia FreeHand 9 and Adobe Photoshop 6. The tip and warning icons were drawn by Christopher Bing. This colophon was written by Genevieve d'Entremont.
I was impressed by the clarity and conciseness of this little book. It was a pleasure to read and I had no problems identifying the places that I did not have to read on the first reading, or that were related to PHP 4 and did not need to study fully.
The examples about PHP 4 (that are then recreated in PHP 5) are carefully chosen to explain how the new language makes things easier and/or more effective and modular with PHP 5. This didactic device is very useful for people that have worked extensively on PHP 4.
This is clearly not a book for people that are just begining on PHP or for those that have little experience on PHP 4. It is better for them to learn from a PHP 5 book (Learning PHP 5 maybe?) directly. However I'd recommend anyone on that situation to then come back and give this book a careful look since many topics are explained here better than in many other places in the literature.
I was especially fond of the chapters on XML, Iterators, and Streams and Wrappers. However all the other chapters were very helpful and I can see myself coming back many times in the future for clarifications on fine point on OO programming, MySQLi, or Error Handling.
Disapointing. The book seems confused, often spending more time telling you about PHP4 workarounds than the PHP5 way of doing things (Should it have been called Downgrading to PHP4?).
Examples are not clearly labelled, meaning that if you dip into this book you may end up applying these PHP4 methods when the whole point is to avoid them. Chapters are very poorly organised, meaning you aren't going to want to sit down and read it.
I found the chapter on OOP particularly confusing. The discussion of constructors and destructors was scattered around the chapter, as was the discussion of public, private and protected methods and properties. Code examples weren't clearly PHP4 or PHP5, either through labelling, the context in the text, and worst of all many that seemed to be examples of PHP4 use mysqli functions that aren't available in PHP4.
Sorry, but this book feels like a dud to me. O'Reilly should be updating Programming PHP and the PHP Pocket Reference, rather than selling this book.