Is there object persistence in PHP 5?

I ask because it seems that with all the associated memory overhead with OOP, I am wondering if there is another reason for PHP to go OOP besides maintainability.

Recommended Answers

All 2 Replies

Since it is stateless you can't persist objects across requests without storing to a file in some way be it a database, cookie(session) or some other flatfile. Not to mention maintainability is one very unimportant reason to pick OOP.

Specifically for this purpose, you would likely use serialize and its opposite, unserialize, to store an object as text.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.