05.05.2013 Views

Programming PHP

Programming PHP

Programming PHP

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Figure 6-2. Object introspection output<br />

An object’s class must be defined before unserialization can occur. Attempting to<br />

unserialize an object whose class is not yet defined puts the object into stdClass,<br />

which renders it almost useless. One practical consequence of this is that if you use<br />

<strong>PHP</strong> sessions to automaticallyserialize and unserialize objects, you must include the<br />

file containing the object’s class definition in everypage on your site. For example,<br />

your pages might start like this:<br />

<br />

...<br />

154 | Chapter 6: Objects<br />

This is the Title of the Book, eMatter Edition<br />

Copyright © 2002 O’Reilly & Associates, Inc. All rights reserved.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!