On 3-Nov-06, at 3:01 PM, Mauro N. Infantino wrote:

Hi all,

In our current codebase for PHP5.1 we've a class named 'Datetime' (I suppose

a lot of people is in the same situation). I'm wondering if there's any
chance
to add an ini directive in order to disable the definition of the new class.

Nil to none.

I mean, we had a lot of PHP4 projects and, with two or three minor changes
we
got them working in PHP5 (as a matter of fact, we didn't experience almost
any
BC trouble... It was kind of easy). How could it be more difficult to
upgrade
from PHP5.1 to PHP5.2? It would be a nightmare too change every date
creation,
and, of course, the type hints. I'd really like to move to PHP5.2 because it

has a lot of really nice things.

Avoid common namespaces and you'll make your application futureproof. When developing a distributed application it is always a good idea to prefix functions/class names with app name or some acronym to avoid overly long names. The way things are going you are going to see more and more classes being introduced by "core" PHP as well as the growing number of PECL extensions out there and I am not even going to mention the thousands of libraries out there.

Ilia Alshanetsky

P.S. If you absolutely must disable it, edit the source code and rename the native class to DateTime2 or something similar.

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

Reply via email to