Hi!
On 7/10/11 9:41 AM, Patrick ALLAERT wrote:
I'm sure some projects have defined classes with those keywords in
some namespace (to ensure they wouldn't conflict with possible PHP
built-in stuff) like in:
namespace \Types {
class Int {
// ...
}
class Float {
// ...
}
class String {
// ...
}
// ...
}
We probably can do it so String is OK, but string is not. But yes, if we
ever have scalar typing, it would conflict with such types I imagine.
But this may be a problem for whoever would venture to create that
patch, if it ever happens.
Developer may have taken care of defining them in a specific
namespace, would it be possible to not break their application while
making them reserved keywords in the global namespace only?
I don't think there's such thing in PHP as namespaced keywords. Keywords
are processed by the language parser, which knows next to nothing of
namespaces.
We could, maybe, prohibit creation of classes with names identical to
type names, which is different from making it reserved word, and on that
stage we know the full class name.
--
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php