|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-07-02 11:31 UTC] johannes@php.net
-Status: Open
+Status: Bogus
[2010-07-02 11:31 UTC] johannes@php.net
[2010-07-02 14:47 UTC] felipe@php.net
-Package: Class/Object related
+Package: Scripting Engine problem
[2010-07-02 14:47 UTC] felipe@php.net
[2010-07-02 14:54 UTC] felipe@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Dec 05 23:00:01 2025 UTC |
Description: ------------ when you use __autoload($var) it will get the class needed depending on the file. by using namespace and getting the class by a full path name ex new \class\name __autload will then try to load classname Test script: --------------- /** index.php **/ function __autoload($var) { require_once($var.'.php'); } //It will try to load the file Coreinit.php and not Core/init.php; new Core\init /** Core/init.php **/ namespace Core; class init{ function __construct(){ echo 'Bingo..!'; } } Expected result: ---------------- that autoload loads Core/init.php Actual result: -------------- autoload loads Coreinit.php