note 73821 added to language.oop5.autoload
| From: | nhawksizzatgmaildizzotcom at osu1 dot php dot net | Date: | Mon, 12 Mar 2007 05:37:36 +0000 |
| Subject: | note 73821 added to language.oop5.autoload | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-124356@lists.php.net to get a copy of this message | ||
I am totally stumped by a problem with my PHP 5.2 install. Help :(
__autoload() just plain don't work on my virtual private server, but it does on my home box.
Here is a super-simple scenario:
In test.php:
<?php
function __autoload($classname) {
include_once(dirname(__FILE__) . "/$classname.php");
}
$thinger = new foo();
echo $thinger->boo;
?>
In foo.php:
<?php
class foo {
var $boo;
function foo() {
$this->boo = "I wouldn't say 'boo' if this autoloader worked on my
server...\n";
}
}
?>
The result of running php test.php:
Fatal error: Cannot instantiate non-existent class: foo in /home/nhawks/test.php on line 8
Works perfectly and gracefully on my home computer ... any ideas?
----
Server IP: 69.147.83.197
Probable Submitter: 72.128.28.33
----
Manual Page -- http://www.php.net/manual/en/language.oop5.autoload.php
Edit -- https://master.php.net/note/edit/73821
Del: integrated -- https://master.php.net/note/delete/73821/integrated
Del: useless -- https://master.php.net/note/delete/73821/useless
Del: bad code -- https://master.php.net/note/delete/73821/bad+code
Del: spam -- https://master.php.net/note/delete/73821/spam
Del: non-english -- https://master.php.net/note/delete/73821/non-english
Del: in docs -- https://master.php.net/note/delete/73821/in+docs
Del: other reasons-- https://master.php.net/note/delete/73821
Reject -- https://master.php.net/note/reject/73821
Search -- https://master.php.net/manage/user-notes.php