Re: Re: PHP 5.1 (Or How to break tousands of apps out there)
| From: | Marcus Boerger | Date: | Mon, 28 Nov 2005 20:05:48 +0000 |
| Subject: | Re: Re: PHP 5.1 (Or How to break tousands of apps out there) | ||
| References: | 1 2 3 4 5 6 7 8 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-20763@lists.php.net to get a copy of this message | ||
Hello Stanislav,
nothing really. I only think that it is easier to have the consts in
the namespace then in an extra class. I probably would call the class
'Config' or 'Setup' or alike then. But if i'd do that i'd be missing
features like static classes.... the php workaround would be 'abstract
final class'. Only:
marcus@zaphod /usr/src/php-cvs $ php -r 'abstract final class Config { const XXX = 42; }'
make: `sapi/cli/php' is up to date.
Parse error: syntax error, unexpected T_FINAL, expecting T_CLASS in Command line code on line 1
regards
marcus
Monday, November 28, 2005, 9:00:02 PM, you wrote:
MB>>>namespace Foo
MB>>>{
> class Behaviour {
MB>>> const XYZ = 42;
> }
MB>>> class Bar
MB>>> {
MB>>> const XXXX = Foo::XYZ;
> const XXXX = Behaviour::XYZ;
MB>>> //...
MB>>> }
> etc. What's wrong with that? Except for the fact that now you can move
> these classes to another namespace if you wanted to and need not to
> hardcode namespace name in each class? :)
> --
> Stanislav Malyshev, Zend Products Engineer
> stas@zend.com http://www.zend.com/ +972-3-6139665 ext.115
Best regards,
Marcus