|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-03-10 18:12 UTC] scottmac@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Dec 12 06:00:01 2025 UTC |
Description: ------------ The parameter of __autoload() is wrong when using a variable to instantiate a namespaced class with aliasing namespace. Reproduce code: --------------- <?php //file 1 function __autoload($className){ var_dump($className); //require($className.'.php'); exit; } use Foo as Bar; new Bar\SomeClass; ?> <?php //file 2 function __autoload($className){ var_dump($className); //require($className.'.php'); exit; } use Foo as Bar; $class = 'Bar\SomeClass'; new $class; ?> Expected result: ---------------- file 1: string(13) "Foo\SomeClass" file 2: string(13) "Foo\SomeClass" Actual result: -------------- file 1: string(13) "Foo\SomeClass" file 2: string(13) "Bar\SomeClass"