From: Operating system: PHP version: Irrelevant Package: Class/Object related Bug Type: Bug Bug description:Importing and Legacy Mode suggestion for PHP 6.0 (7.0?)
Description: ------------ Currently the internal PHP function library is, well, unique. Proposed is a means to maintain backward compatibility while rectifying the problem and hopefully on the engine side speed up the process by reducing what the zend engine has to track. import keyword. import attaches the specified namespace to the current one. An error is thrown if there is a symbol collision between the namespaces. namespace Bar { function Foo(){} } namespace Test { import \Bar Foo() // works Bar\Foo() // doesn't work - try use Bar instead. } If import is asked to pull a namespace that doesn't exist there's an error. Import has one other use. namespace Test; import @PDO; This pulls the PDO library of PHP 6 into the Test namespace. This brings us back to the solution of the function library problem. PHP 6 would ship with a legacy mode set to true. In that mode everything is as now - the namespace \ having thousands of functions. Turn it off though and namespace \ is empty except for a core selection of functions and objects. The rest of the function library will be divided into libraries that can be imported as needed. Legacy functions remain available in library legacy so namespace MyNamespace; import @Legacy; would let code in MyNamespace use the current function library. -- Edit bug report at http://bugs.php.net/bug.php?id=53160&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=53160&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=53160&r=trysnapshot53 Try a snapshot (trunk): http://bugs.php.net/fix.php?id=53160&r=trysnapshottrunk Fixed in SVN: http://bugs.php.net/fix.php?id=53160&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=53160&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=53160&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=53160&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=53160&r=needscript Try newer version: http://bugs.php.net/fix.php?id=53160&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=53160&r=support Expected behavior: http://bugs.php.net/fix.php?id=53160&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=53160&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=53160&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=53160&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=53160&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=53160&r=dst IIS Stability: http://bugs.php.net/fix.php?id=53160&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=53160&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=53160&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=53160&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=53160&r=mysqlcfg