Guest Carl Posted March 26, 2010 Report Share Posted March 26, 2010 Just a quick question. I have just watched the videos on OO programming in PHP and I recommend them they are very good. One question I have is, is it necessary to free an object at the end of a script? Like in other languages? And how is it possible to have a created object available to other scripts. For example crate an object in script a.php set some variables and have script b.php reference it? Or is that not possible. Kind regards Carl... Quote Link to comment Share on other sites More sharing options...
administrator Posted March 26, 2010 Report Share Posted March 26, 2010 Hi, To answer your questions: One question I have is, is it necessary to free an object at the end of a script? Like in other languages? No. Once a script executes it is dumped. ... although it is probably a good idea to free up resources as soon as you can. Contrast this to Java, where you should explicitly free up resources ... even though there is garbage collection. And how is it possible to have a created object available to other scripts. Use php session. That is to say, stick them in session. You should take a look at our PHP shopping cart video course because it covers these kinds of things. In fact the Shopping cart screencast is really a vehicle to teach a little bit more advanced PHP. Stefan 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.
Note: Your post will require moderator approval before it will be visible.