Jump to content


Photo

Object Persistence?


  • Please log in to reply
3 replies to this topic

#1 Brandomonium

Brandomonium
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 15 March 2006 - 06:54 AM

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.



#2 keeB

keeB
  • Staff Alumni
  • Advanced Member
  • 1,078 posts
  • LocationCalifornia

Posted 15 March 2006 - 07:16 AM

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.

Come visit my site to see my latest projects
http://nick.stinemates.org/wordpress/


#3 Brandomonium

Brandomonium
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 16 March 2006 - 02:31 AM

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.



#4 hitman6003

hitman6003
  • Members
  • PipPipPip
  • Advanced Member
  • 1,807 posts

Posted 16 March 2006 - 02:48 AM

[!--quoteo(post=355552:date=Mar 15 2006, 09:31 PM:name=Brandomonium)--][div class=\'quotetop\']QUOTE(Brandomonium @ Mar 15 2006, 09:31 PM) View Post[/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.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users