#47239 [NEW]: Wrong example of using namespace keyword

From: Date: Thu, 29 Jan 2009 15:00:08 +0000
Subject: #47239 [NEW]: Wrong example of using namespace keyword
Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-1771@lists.php.net to get a copy of this message
From: kenashkov at gmail dot com Operating system: irrelevant PHP version: Irrelevant PHP Bug Type: Documentation problem Bug description: Wrong example of using namespace keyword Description: ------------ In the manual in the section for the "namespace" keyword and __NAMESPACE__ constant is given wrong example code. Both calls call the same function - MyProject\blah\mine(); Tested on php 5.3-beta1 Reproduce code: --------------- <? namespace MyProject; use blah\blah as mine; // see "Using namespaces: importing/aliasing" blah\mine(); // calls function blah\blah\mine() //!wrong! namespace\blah\mine(); // calls function MyProject\blah\mine() ?> Expected result: ---------------- <? namespace MyProject; use blah\blah as mine; // see "Using namespaces: importing/aliasing" blah\mine(); // calls function MyProject\blah\mine() namespace\blah\mine(); // calls function MyProject\blah\mine() ?> -- Edit bug report at http://bugs.php.net/?id=47239&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=47239&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=47239&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=47239&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=47239&r=fixedcvs Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=47239&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=47239&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=47239&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=47239&r=needscript Try newer version: http://bugs.php.net/fix.php?id=47239&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=47239&r=support Expected behavior: http://bugs.php.net/fix.php?id=47239&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=47239&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=47239&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=47239&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=47239&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=47239&r=dst IIS Stability: http://bugs.php.net/fix.php?id=47239&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=47239&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=47239&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=47239&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=47239&r=mysqlcfg

« previous php.doc.bugs (#1771) next »