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
hello all, I need some sample placement papers in lion bridge.. can anyone help me?
List some features of php that are deprecated in php7?
how to detect a mobile device using php
Name and explain five of the PHP error constants?
Tell me what kind of things have you done on the social side?
What is difference between static and final in php?
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
Which variable declarations within a class is invalid in php?
How to create a web form?
sort term descripttion form, report and uery
How to calculate the difference between two dates using php?
What is the current stable version of php? What advance thing in php7?
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
What is trait in php?
What is the difference between htmlentities() and htmlspecialchars()?