Brandomonium Posted March 15, 2006 Share Posted March 15, 2006 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. Quote Link to comment Share on other sites More sharing options...
keeB Posted March 15, 2006 Share Posted March 15, 2006 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. Quote Link to comment Share on other sites More sharing options...
Brandomonium Posted March 16, 2006 Author Share Posted March 16, 2006 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. Quote Link to comment Share on other sites More sharing options...
hitman6003 Posted March 16, 2006 Share Posted March 16, 2006 [!--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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.