Bug #54893 [NEW]: Namspace import doesn't work
| From: | marcel dot klehr at gmx dot de | Date: | Fri, 20 May 2011 13:19:56 +0000 |
| Subject: | Bug #54893 [NEW]: Namspace import doesn't work | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-160867@lists.php.net to get a copy of this message | ||
From:
Operating system: Windows 7
PHP version: 5.3SVN-2011-05-20 (SVN)
Package: *Compile Issues
Bug Type: Bug
Bug description:Namspace import doesn't work
Description:
------------
I'm running XAMPP on Win7 with PHP 5.3.5 (don't know whether I got that one
above selected right...)
I tried importing a namespace and instantiating a class in there in another
namespace, but it seemed not to have worked.
---
From manual page: http://www.php.net/language.namespaces.importing
---
Test script:
---------------
<?php
namespace NamespaceOne
{
class OutOfBoundsException extends \OutOfBoundsException
{
}
}
namespace NamespaceTwo
{
use NamespaceOne;
throw new OutOfBoundsException;
}
?>
Expected result:
----------------
Fatal error: Uncaught exception 'NamespaceOne\OutOfBoundsException'
Actual result:
--------------
Fatal error: Class 'NamespaceTwo\OutOfBoundsException' not found in ...
--
Edit bug report at http://bugs.php.net/bug.php?id=54893&edit=1
--
Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=54893&r=trysnapshot52
Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=54893&r=trysnapshot53
Try a snapshot (trunk): http://bugs.php.net/fix.php?id=54893&r=trysnapshottrunk
Fixed in SVN: http://bugs.php.net/fix.php?id=54893&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=54893&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=54893&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=54893&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=54893&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=54893&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=54893&r=support
Expected behavior: http://bugs.php.net/fix.php?id=54893&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=54893&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=54893&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=54893&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=54893&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=54893&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=54893&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=54893&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=54893&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=54893&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=54893&r=mysqlcfg