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

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -