Re: tired of referencing static variables/constants with 'self ::'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



D. Dante Lorenso wrote:
As an OOP programmer, I would expect the scope search to be as follows:
  1. LOCAL: current method
  2. THIS: current instance ($this)
  3. SELF: current class & parent classes, in order of inheritance
  4. GLOBAL: globals

Actually, 2 and 3 are really the same but only vary whether the class member was referenced via an object or statically, and this SHOULD already be known to PHP based on the class declaration. So, forcing a programmer to constantly embed the 'this is a static reference (self::)' or 'this is not a static reference ($this->)' prepended to each variable is definitely boiler-plate, redundant, and not necessary.

Dante

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux