Multiple choice technology web technology

Which is the correct way to call an object method?

  1. $object.method()
  2. $object->$method()
  3. $object:$method()
  4. $object->method()
Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

In PHP, object methods are called using the arrow operator (->), which is the standard syntax for accessing properties and methods of an object. This is distinct from languages like JavaScript or Java that use dot notation.