pman
03-16-2008, 06:01 PM
I'm trying to get into writing OOP in PHP. Using PHP5. I know the basic structure of a class, variable and functions, but getting confused when looking at different tutorial.
Inside a class, some are declaring function like:
public function doSomething()
while others are writing
public doSomething()
Some are even writing
function doSomething()
Now, what is the difference in here? Who is right? I think the first two are more like how OOP should be (correct me if I'm wrong).
And, what about declaring variables? I believe it should it be:
public $myVar
Hope you can clarify my confusion here. Thanks
Inside a class, some are declaring function like:
public function doSomething()
while others are writing
public doSomething()
Some are even writing
function doSomething()
Now, what is the difference in here? Who is right? I think the first two are more like how OOP should be (correct me if I'm wrong).
And, what about declaring variables? I believe it should it be:
public $myVar
Hope you can clarify my confusion here. Thanks