2010/1/22 Jochem Maas <joc...@iamjochem.com>:
> constants in interfaces are not meant for this. a class constant doesn't
> constitute an interface. I believe constants in interfaces are allowed purely
> because it is helpful to have them defined outside of the global space and
> somewhere where all implementors of said interface can realiably reference 
> them.

Yep.

> I would suggest you need to define some extra methods in your interface e.g.
>
>        function getKillNotes();
>        function getKillTypeFlag();

The other option would be to be able to _easily_ detect the presence
of a class constant.

Without an error.

Fatal or otherwise.

$rfClass = ReflecionClass('KilledClass');
if (in_array('KILL_SWITCH_NOTES', $rfClass->getConstants())) { ...}

seems the only way.

You can't use getConstant('KILL_SWITCH_NOTES') as False is returned
for failure with no differentiation for a False value. Grrr.




Thanks to you all for the discussion.

Regards,

Richard.

-- 
-----
Richard Quadling
"Standing on the shoulders of some very clever giants!"
EE : http://www.experts-exchange.com/M_248814.html
EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
ZOPA : http://uk.zopa.com/member/RQuadling

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

Reply via email to