OOP PHP4

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
technics
Forum Newbie
Posts: 16
Joined: Sun Feb 13, 2005 6:50 pm

OOP PHP4

Post by technics »

Hi coders,

Can somebody recommend a good OOP PHP4 tutorial website?

Also a question; if PHP4 passes variables by value not reference then that means memory unit(s) is allocated each time we pass a variable. When the focus changes from function A to function B, what happens to the variable in function A? It still stays there I assume - using up memory?
Now say function B has finished - what happens to the variables within? is it in memory still?

I need a good OOP website for PHP4 too!
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

it may be easier to find OOP information in general.

As for variable passing, yes function A keeps its variables on the stack. When function B terminates, all variables (except static ones) are unallocated. PHP uses smart memory management. Meaning that garbage collection is performed for you, most of the time. In 4, you can most often, pass variables by reference.
Post Reply