I think the following example is much better, however I am not sure it's a right direction. Namespaces are intended to declare names that can conflict with names from other namespaces (including global namespace), do I am not sure that we need special keyword for internal functions.
We'll think little bit more. Anyway thank you for feedback and idea. <?php namespace UTF8; overloaded class Exception { } overloaded function strlen() { } ?> Thanks. Dmitry. > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of David Coallier > Sent: Thursday, July 05, 2007 5:35 PM > To: Stefan Priebsch > Cc: Dmitry Stogov; PHP internals > Subject: Re: [PHP-DEV] Simple Namespace Proposal > > > On 7/5/07, Stefan Priebsch <[EMAIL PROTECTED]> wrote: > > David Coallier schrieb: > > > I would probably be in favor of throwing a notice or a > warning when > > > someone modifies a built-in function (or even throw an exception) > > > and that way as soon as you do such thing you would know > right away > > > that you modified something and you would know where the > > > modification happened which would make things much easier > for people > > > developing and debugging applications. > > > > The problem is that this kind of overloading makes a nice > feature as > > well. This is runied by throwing an exception, and cautious > developers > > will at least get nervous when they see a notice. > > > > I could imagine that by adding something like "overrides foo()" or > > "overloads foo()" to a function/method declaration the > developer could > > make clear that he willingly overrides a built-in function, and if > > this is missing, an exception is being thrown. This may be a little > > over the top, however. > > > > Yep I see what you mean.. could even be something like: > > namespace UTF8; > > overrides { > strlen(); > strcmp(); > } > > function strlen($string) > { > return strlen($string) + 666; // This is just an example ! } ... > > > I kinda like the overrides part, however I wonder if people > will actually use it.. Oh well.. my two cents are now gone. > > > > Kind regards, > > > > Stefan > > > > -- > > >e-novative> - We make IT work for you. > > > > e-novative GmbH - HR: Amtsgericht München HRB 139407 > > Sitz: Wolfratshausen - GF: Dipl. Inform. Stefan Priebsch > > > > http://www.e-novative.de > > > > > > -- > David Coallier, > Founder & Software Architect, > Agora Production (http://agoraproduction.com) > 51.42.06.70.18 > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php