Hi!

Trying to fudge the behavior of PHP to fit some kind of presumed usage patterns is what got us features like magic quotes and register globals.

You sound like these usage patterns are figment of my imagination. They are not. As for magic quotes and register globals, I understand that's very convenient argument to say "your ideas is exactly what lead to these", only this has nothing to do with current case. Yes, in past in PHP were some decisions that proved to be wrong later. But bringing them up in each discussion regardless of its relevance is not going to convince anybody.

Namespaces were introduced to solve the problems of large scale projects, and I think anyone on this list can agree that on a large scale project, small hacks like these are a hindrance and not an aid.

It's not "small hacks". It's supporting the way PHP is used in 100% of existing code.

internal or user. But in namespace context I'll have to do something along the lines of:

if (function_exists('json_encode')) {
   $encoded = json_encode($raw);
} else {
   $encoded = ::json_encode($raw);
}

What this code is supposed to do? If it's supposed to call namespace's json_encode in case global one is not defined, I see nothing wrong with it. If it is intended to call globally defined json_encode, then you just write ::json_encode, no ifs. The thing is you'd need to do it *ONLY* for json_encode, and only because you want to do something special with it. The principle is - common case is free, special cases are available, but for a "fee" - additional code.

--
Stanislav Malyshev, Zend Software Architect
[EMAIL PROTECTED]   http://www.zend.com/
(408)253-8829   MSN: [EMAIL PROTECTED]

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

Reply via email to