![]() |
PHP programmers in here please!
if I had a class lets say
class myclass { function myfunction() { } } Why in the world would I do $myclass = new myclass and use the function as $myclass->myfunction while I can forget all that and just do myclass::myfunction() what can be a possible reason not to use the double colon way?? i can't think of any... |
the point of classes isn't so you can put functions inside of them...
the point is that you create objects, which have certain properties, and you make them do stuff by calling certain methods... |
thanks for your reply
I get it now using :: is just static while the other way I could do $myclass1 = new myclass("yourname") $myclass2 = new myclass("myname") then $myclass1 and $myclass2 would refer to the same class but have different properties.. intresting stuff.... but why php can only extend one class? |
Quote:
|
All times are GMT -7. The time now is 12:44 AM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123