> Or "namespaces"... Or just plain "modules". Classes is not the only way to > group things, and may not be the best (namespaces can typically be > Oh, of course it's not the only way. It's the only way native to PHP though. > re-opened, so functions and classes belonging to a namespace can span > several files, instead of everything having to be in _one_ file). > Thus, how do you suppose autoloading function would know which file to load? We are back to the "complex ugly logic" argument. > Why? Besides the above, because you may want to be able to call a function > like: > > f(); > > and not: > > SomeClassToWrapItAll::f(); > You may call the class x if you like one-letter names :) Besides that, saving keystrokes was never a top priority for PHP (see how elaborate function names standard modules have). Keystrokes are cheap, clarity of the code isn't. > class. So in Java, instead of being able to write "sqrt(<number>)", you have > to write "Math::sqrt(<number>)". Always. > Frankly, I don't really see it as advantage or disadvantage, it's just another way to say the same. Java, for good and for bad, is much more organized and bureaucratic language than PHP. In PHP nobody makes you to use classes if you don't like them, I am just saying trying to make functions behave like they belong to class or module without either saying "class" or "module" (i.e. include) may not be the best idea to support.
-- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php