From:             seanius at debian dot org
Operating system: Debian GNU/Linux
PHP version:      5.2.1
PHP Bug Type:     Scripting Engine problem
Bug description:  __autoload not invoked in cli interactive mode?

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 bug report at http://bugs.php.net/?id=40775&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=40775&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=40775&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=40775&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=40775&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=40775&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=40775&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=40775&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=40775&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=40775&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=40775&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=40775&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=40775&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=40775&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=40775&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=40775&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=40775&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=40775&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=40775&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=40775&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=40775&r=mysqlcfg

Reply via email to