> > > Right. You can have namespace UTF8 and function strlen() in it.
> >
> > This kind of "overriding" would make an interesting feature! However, if
> > a programmer creates - by coincidence - a method with the name of an
> > built-in PHP function, he alters the program's behaviour; from another
> > point of view, this is something that should be forbidden, as I think it
> > could be a source of hard-to-find errors.

I would be in favour of allowing built-in function names to be used. One
of the great things about namespaces is that I can use "foo" for a
function and never have to worry about needing to re-write parts of my
application because someone added a built-in function called "foo" to a
later version of PHP.

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


Throwing exceptions is a bad idea. Developers will simply "overload"
every function just in case new versions of PHP introduce a function
with the same name.

Personally I would scrap the "overload" keyword and use a setting in
php.ini to control logging this kind of notice. You really only care
about these messages during development and having it in the php.ini
makes it easy to disable. Additionally, I think many newer programmers
will get confused about when/why they should be using "overload"
resulting in overuse.

   Rich




-- 
Rich Buggy
[EMAIL PROTECTED]
http://www.buggy.id.au/

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to