#40775 [Opn->Asn]: __autoload not invoked in cli interactive mode?
| From: | tony2001@php.net | Date: | Mon, 12 Mar 2007 09:58:24 +0000 |
| Subject: | #40775 [Opn->Asn]: __autoload not invoked in cli interactive mode? | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-110226@lists.php.net to get a copy of this message | ||
ID: 40775
Updated by: tony2001@php.net
Reported By: seanius at debian dot org
-Status: Open
+Status: Assigned
Bug Type: Scripting Engine problem
Operating System: Debian GNU/Linux
PHP Version: 5.2.1
-Assigned To:
+Assigned To: tony2001
Previous Comments:
------------------------------------------------------------------------
[2007-03-11 12:20:45] seanius at debian dot org
Description:
------------
the __autoload hook doesn't seem to be run for the cmdline/cgi versions
of php when invoked in "interactive" (-a) mode.
originally reported at http://bugs.debian.org/406264
Reproduce code:
---------------
<?php
function __autoload($class)
{
echo $class;// should output class name
echo 'lol';// should at least print it if it comes into function body
require($class . '.php');// should break script because of missing
file
}
// but it will just cause fatal error about missing class :|
$foo = new Bar(); ?>
Expected result:
----------------
client-158[~]13:14:49$ php < foo.php
Barlol
Warning: require(Bar.php): failed to open stream: No such file or
directory in - on line 6
Fatal error: require(): Failed opening required 'Bar.php'
(include_path='.:/usr/share/php:/usr/share/pear') in - on line 6
Actual result:
--------------
client-158[~]13:14:54$ php -a < foo.php
Interactive mode enabled
Fatal error: Class 'Bar' not found in - on line 9
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=40775&edit=1