Re: [PHP-DEV] Simple Namespace Proposal
by Rich Buggy other posts by this author
Jul 6 2007 8:25AM messages near this date
Re: [PHP-DEV] Simple Namespace Proposal
|
Re: [PHP-DEV] Simple Namespace Proposal
> > > 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
rich@[...].au
http://www.buggy.id.au/
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
Thread:
Dmitry Stogov
Derick Rethans
Dmitry Stogov
Dmitry Stogov
dz
David Coallier
Guilherme Blanco
Stanislav Malyshev
Dmitry Stogov
Markus Fischer
Stanislav Malyshev
Stanislav Malyshev
Stanislav Malyshev
Giedrius D
Stanislav Malyshev
Giedrius D
Stanislav Malyshev
Giedrius D
Andrew Minerd
Stanislav Malyshev
David Coallier
Chris#
Dmitry Stogov
nicobn
Chris#
Chrish
Dmitry Stogov
Andrei Zmievski
Stefan Priebsch
Stanislav Malyshev
Richard Lynch
Dmitry Stogov
Stanislav Malyshev
Andrei Zmievski
Stefan Priebsch
Stanislav Malyshev
Stefan Priebsch
Richard Lynch
Stefan Priebsch
Jani Taskinen
David Coallier
Robert Cummings
Richard Lynch
Stanislav Malyshev
Lukas Kahwe Smith
Derick Rethans
Stefan Priebsch
Stanislav Malyshev
Derick Rethans
Stanislav Malyshev
Stanislav Malyshev
Stanislav Malyshev
Dmitry Stogov
Stefan Priebsch
Dmitry Stogov
Jeremy Privett
Stanislav Malyshev
nicobn
Tony Bibbs
Stanislav Malyshev
Stefan Priebsch
David Coallier
Rich Buggy
Stanislav Malyshev
Stefan Priebsch
David Coallier
Dmitry Stogov
Andrei Zmievski
Hans Lellelid
dz
Guilherme Blanco
Alexey Zakhlestin
Stanislav Malyshev
Jeremy Privett
Dmitry Stogov
Arpad Ray
Dmitry Stogov
Stanislav Malyshev
Markus Fischer
David Coallier
Stanislav Malyshev
Brian Moon
Dmitry Stogov
Stanislav Malyshev
Brian Moon
Stanislav Malyshev
Dmitry Stogov
Stefan Walk
Dmitry Stogov
David Coallier
Dmitry Stogov
Stefan Priebsch
Stanislav Malyshev
Stefan Priebsch
Larry Garfield
Dmitry Stogov
Larry Garfield
Dmitry Stogov
Derick Rethans
Dmitry Stogov
nicobn
Sebastian Bergmann
Dmitry Stogov
nicobn
Rasmus Lerdorf
Lucas Nealan
Stefan Priebsch
Rasmus Lerdorf
Stefan Priebsch
Sebastian Bergmann
Stefan Priebsch
Dmitry Stogov
Sebastian Bergmann
Stanislav Malyshev
davidc
Stanislav Malyshev
|