Re: Mistake: Autoloading Objects

From: Date: Mon, 18 Oct 2004 10:30:53 +0000
Subject: Re: Mistake: Autoloading Objects
References: 1 2  Groups: php.doc 
Request: Send a blank email to phpdoc+get-969364574@lists.php.net to get a copy of this message
has already been commited :) Seems you missed the commit message ;) Aidan Lister wrote:
We should probably use PEAR CS, and require instead of include: function __autoload($class_name) {
     require_once $class_name . '.php';
} I didn't see your commit, so assuming it's still local (waiting to be commited) we'll save the translators a commit "Sean Coates" <sean@caedmon.net> wrote in message news:61302.70.48.60.88.1098077592.squirrel@70.48.60.88...
Hello, I saw your note, and fixed the docs (in CVS), already. Thanks very much for pointing it out. In the future, however, it would be best to file this sort of problem as a documentation problem at bugs.php.net. Thanks again, S Kishan Hickman wrote:
Hi guys, In the Autoloading Objects Section of your documentation I believe you
have a small error in the example you gave, the example is: <?php function __autoload($class_name) { include_once($class_name . 'php'); } $obj = new MyClass1(); $obj2 = new MyClass2(); ?> In the third line of this example I believe there should be a "." Before
the php i.e. include_once($class_name . '.php'); if I am incorrect about this sorry for taking your time cheers Kishan


« previous php.doc (#969364574) next »