oop - Why does PHP require an explicit reference to "$this" to call member functions? -
It is very clear in most OO programming languages, a clear reference to the scrolling, the current instance (i.e. in PHP in '$ this') Resolve the symbols without Why does PHAP do me so that each call should be kept in the same class with $ member in a member function?
To resolve the scope of the function call. Consider:
$ this-> Strstr (...
and simply
strstr (...
the latter PHP's built-in strstr ( ) Will call the function that we do not want to do here.
This is a result of adding OOP features in the top level processive / scripting language.
Comments
Post a Comment