![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Confirmed User
Industry Role:
Join Date: Sep 2006
Posts: 1,542
|
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...
__________________
------ Offcourse its a dude posting here. Probably a fut ugly one too. Fuck still people falling for this 100 year old trick |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
<&(©¿©)&>
Industry Role:
Join Date: Jul 2002
Location: Chicago
Posts: 47,882
|
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...
__________________
Custom Software Development, email: woj#at#wojfun#.#com to discuss details or skype: wojl2000 or gchat: wojfun or telegram: wojl2000 Affiliate program tools: Hosted Galleries Manager Banner Manager Video Manager ![]() Wordpress Affiliate Plugin Pic/Movie of the Day Fansign Generator Zip Manager |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
Confirmed User
Industry Role:
Join Date: Sep 2006
Posts: 1,542
|
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?
__________________
------ Offcourse its a dude posting here. Probably a fut ugly one too. Fuck still people falling for this 100 year old trick |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
Bollocks
Industry Role:
Join Date: Jun 2007
Location: Bollocks
Posts: 2,793
|
PHP doesn't support multiple inheritance if that's what you mean. But you can derive a class from another class that is derived from another class and so on.
__________________
Interserver unmanaged AMD Ryzen servers from $73.00 |
![]() |
![]() ![]() ![]() ![]() ![]() |