#48955 [Opn->Bgs]: different namespace passing to autoloader

From: Date: Fri, 24 Jul 2009 09:25:45 +0000
Subject: #48955 [Opn->Bgs]: different namespace passing to autoloader
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-140184@lists.php.net to get a copy of this message
ID: 48955 Updated by: jani@php.net Reported By: schunke at gmx dot net -Status: Open +Status: Bogus Bug Type: Scripting Engine problem Operating System: * PHP Version: 5.3.0 New Comment: \n inside double quotes is escape char of newline. No bug here. Previous Comments: ------------------------------------------------------------------------ [2009-07-17 09:53:21] schunke at gmx dot net Description: ------------ Theres a difference in namespace passing to an autoloader. That may cause several problems and it should be the same. Reproduce code: --------------- <?php function __autoload($value) { echo $value; } new \ns\className; $a = "\ns\className"; new $a; ?> Expected result: ---------------- Same passing of namespace to autoloader as new \ns\className -> ns\className and $a = "\ns\className"; new $a; -> ns\className Actual result: -------------- new \ns\className -> autoloader gets ns\className $a = "\ns\className"; new $a; -> autoloader gets \ns\className (the first backslash is the problem) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=48955&edit=1

« previous php.bugs (#140184) next »