What are the different ways where we can use object operators ->
in PHP?
82
votes
Why is this closed? People are upvoting this question 8 years later, and there are sufficient answers to the question. Clearly, it's pretty easy to see what's being asked here.
– DeltaFlyer
@DeltaFlyer Vote for reopening this question
– Stephan
5 Answers
118
votes
29
votes
11
votes
4
votes
1
votes
"->" operator is the PHP related callable content. always use to call an instance method and access instance.
"::" scope operator is used for the instance that is used for calling the static method and constant it's very different with::
It's a proper reply to them, I have got new knowledge.
Please check the name conflicts for the above different operator.