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 ::?

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

hello all, I need some sample placement papers in lion bridge.. can anyone help me?

2146


List some features of php that are deprecated in php7?

1008


how to detect a mobile device using php

1160


Name and explain five of the PHP error constants?

1011


Tell me what kind of things have you done on the social side?

1051


What is difference between static and final in php?

1071


How can we extract string "pcds.co.in" from a string "https://info@pcds.co.in" using regular expression of php? More on reg can you explain

1058


Which variable declarations within a class is invalid in php?

1035


How to create a web form?

1091


sort term descripttion form, report and uery

2249


How to calculate the difference between two dates using php?

1116


What is the current stable version of php? What advance thing in php7?

1072


if you run the app program all vendor open items are cleared but is it possible to reverse the again again open items please tell me the answer

1970


What is trait in php?

1051


What is the difference between htmlentities() and htmlspecialchars()?

1072