|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-11-25 14:56 UTC] asonge@php.net
[2008-11-25 19:43 UTC] jani@php.net
[2008-11-25 21:14 UTC] felipe@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Dec 03 08:00:02 2025 UTC |
Description: ------------ Using a variable to instantiate a namespaced class (eg, new $foo();) causes truncated data to be passed to the autoloader when the class is prepended with \. Reproduce code: --------------- <?php // File 1 $baz = '\\Foo\\Bar\\Baz'; new $baz(); function __autoload($class) { var_dump($class); require './test.php'; } ?> <?php // File 2 namespace Foo\Bar; class Baz { } ?> Expected result: ---------------- Foo\Bar\Baz or \Foo\Bar\Baz in the var_dump Actual result: -------------- \Foo\Bar\Ba (missing the z)