#43033 [Opn->Bgs]: Class not found in global scope

From: Date: Fri, 19 Oct 2007 11:21:47 +0000
Subject: #43033 [Opn->Bgs]: Class not found in global scope
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-118711@lists.php.net to get a copy of this message
ID: 43033 Updated by: derick@php.net Reported By: felipensp at gmail dot com -Status: Open +Status: Bogus Bug Type: Scripting Engine problem Operating System: Linux PHP Version: 5.3CVS-2007-10-19 (snap) New Comment: Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php foobar is not defined in the global namespace, but in the namespace A. Previous Comments: ------------------------------------------------------------------------ [2007-10-19 11:12:02] felipensp at gmail dot com Description: ------------ The README.namespace said "Note that using "new A" in namespace you can only create class from this namespace or internal PHP class, however using "new ::A" you are able to create any class from the global namespace." But, the class defined in global scope isn't found. Reproduce code: --------------- <?php namespace A; class foobar { public function test() { } } new ::foobar(); Expected result: ---------------- No error. Actual result: -------------- Fatal error: Class 'foobar' not found ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=43033&edit=1

« previous php.bugs (#118711) next »