Jump to content

Archived

This topic is now archived and is closed to further replies.

Brandomonium

Object Persistence?

Recommended Posts

Quick question -

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 OO besides maintainability.

Share this post


Link to post
Share on other sites
Maybe I am a newb, but what is Object Persistence?

I use objects mostly for maintainability and data / code consistency.. combined with sessions, it's quite powerful.

Share this post


Link to post
Share on other sites
In this case, Object Persistence would mean you can keep objects around after a script has been run.

I can't see this happening because once the script has executed, control is turned back over to the web server, and the PHP interpreter is cleaning up after the execution thread -- unless it doesn't.

Share this post


Link to post
Share on other sites
[!--quoteo(post=355552:date=Mar 15 2006, 09:31 PM:name=Brandomonium)--][div class=\'quotetop\']QUOTE(Brandomonium @ Mar 15 2006, 09:31 PM) [snapback]355552[/snapback][/div][div class=\'quotemain\'][!--quotec--]
I can't see this happening
[/quote]

You are correct.

You can create semi persistant variables using sessions and the like, but once the script ends, just like you would expect, all vars and objects, and usually, db connections are lost.

The only exception to this would be persistant db connections, which remain for a period of time.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.