Visibility of class constant

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

 



I got a weird behaviour of class constant. Suppose I have Index_Controller
and Another_Controller classes, both extending Controller class. I define
some constants (let's assume I only have one, call it MY_CONST) in
Controller class to be used by its descendants. In Index_Controller, I can
freely use MY_CONST without parent:: needed. However, this isn't the case
with Another_Controller. Without parent:: I got notice Use of undefined
constant MY_CONST - assumed 'MY_CONST'. How could this happen and what's the
correct behaviour? It's actually nicer to have it without parent::, assuming
that constants have protected visibility specifier (which isn't possible
AFAIK :-( ).
-- 
View this message in context: http://www.nabble.com/Visibility-of-class-constant-tp21803985p21803985.html
Sent from the PHP - General mailing list archive at Nabble.com.


-- 
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