Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


What's the difference between accessing a class method via -> and via ::?



What's the difference between accessing a class method via -> and via ::?..

Answer / Barkha Rai

In PHP, the `->` operator is used for calling methods on an instance of a class. For example: `$obj->method()`. On the other hand, the `::` operator is used for static methods and function-like properties. It's called as `ClassName::methodName()`, without any object instance.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More PHP Interview Questions

difference of move(), and copy() function in php?

3 Answers  


Explain me what is the use of header() function in php?

1 Answers  


What is $_ get in php?

1 Answers  


How to call a php function from another php file?

1 Answers  


What is php in simple words?

1 Answers  


what is the maximum size of databasi in mysql?

4 Answers  


What is php programming used for?

1 Answers  


Is php object oriented?

1 Answers  


What is the use of magic function in php?

1 Answers  


Write a program using while loop in php?

1 Answers  


How to Define a Constant in PHP? Is $ symbol necessary?

6 Answers   Maples,


What are the advantages of php mysql?

1 Answers  


Categories