Method Or Property?

../_images/method_or_property.png

The first line is a simple call to the method foo, on an object whose class is not show here: if this works, there is a method foo() in that class.

The second line is a simple call to the property foo, on an object whose class is not know (again): it has a property called foo. Then, the result of that property, hopefully a string with a class name, or another object, is instantiated, without any arguments.

The nuance is subtle.

See Also

PHP Features