Ask a Question related to PHP Bugs, Design and Development.
-
seanius at debian dot org #1
#40775 [NEW]: __autoload not invoked in cli interactive mode?
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 [url]http://bugs.debian.org/406264[/url]
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 [url]http://bugs.php.net/?id=40775&edit=1[/url]
--
Try a CVS snapshot (PHP 4.4): [url]http://bugs.php.net/fix.php?id=40775&r=trysnapshot44[/url]
Try a CVS snapshot (PHP 5.2): [url]http://bugs.php.net/fix.php?id=40775&r=trysnapshot52[/url]
Try a CVS snapshot (PHP 6.0): [url]http://bugs.php.net/fix.php?id=40775&r=trysnapshot60[/url]
Fixed in CVS: [url]http://bugs.php.net/fix.php?id=40775&r=fixedcvs[/url]
Fixed in release: [url]http://bugs.php.net/fix.php?id=40775&r=alreadyfixed[/url]
Need backtrace: [url]http://bugs.php.net/fix.php?id=40775&r=needtrace[/url]
Need Reproduce Script: [url]http://bugs.php.net/fix.php?id=40775&r=needscript[/url]
Try newer version: [url]http://bugs.php.net/fix.php?id=40775&r=oldversion[/url]
Not developer issue: [url]http://bugs.php.net/fix.php?id=40775&r=support[/url]
Expected behavior: [url]http://bugs.php.net/fix.php?id=40775&r=notwrong[/url]
Not enough info: [url]http://bugs.php.net/fix.php?id=40775&r=notenoughinfo[/url]
Submitted twice: [url]http://bugs.php.net/fix.php?id=40775&r=submittedtwice[/url]
register_globals: [url]http://bugs.php.net/fix.php?id=40775&r=globals[/url]
PHP 3 support discontinued: [url]http://bugs.php.net/fix.php?id=40775&r=php3[/url]
Daylight Savings: [url]http://bugs.php.net/fix.php?id=40775&r=dst[/url]
IIS Stability: [url]http://bugs.php.net/fix.php?id=40775&r=isapi[/url]
Install GNU Sed: [url]http://bugs.php.net/fix.php?id=40775&r=gnused[/url]
Floating point limitations: [url]http://bugs.php.net/fix.php?id=40775&r=float[/url]
No Zend Extensions: [url]http://bugs.php.net/fix.php?id=40775&r=nozend[/url]
MySQL Configuration Error: [url]http://bugs.php.net/fix.php?id=40775&r=mysqlcfg[/url]
seanius at debian dot org Guest
-
[PHP-DEV] __autoload() lowercase
We run into a problem, when tryng to organize class files since autoload always uses lowercase. My class file, for example, is named... -
[PHP-DEV] __autoload & exceptions
Marcus- Here are just some interesting observations with __autoload() and exceptions: Currently, an empty php file with just "throw new... -
interactive mode post
Is there a way to simulate "POST mode user input" while running PHP from the command line or in interactive mode? For example with python, you can... -
#24922 [Ver->Csd]: php CLI gets a segmentation fault in interactive mode with a simple foreach
ID: 24922 Updated by: helly@php.net Reported By: llucax@php.net -Status: Verified +Status: Closed... -
#24922 [NEW]: php CLI gets a segmentation fault in interactive mode with a simple foreach
From: llucax@php.net Operating system: Linux 2.4.21 (debian sid) PHP version: 5.0.0b1 (beta1) PHP Bug Type: Reproducible... -
tony2001@php.net #2
#40775 [Opn->Asn]: __autoload not invoked in cli interactive mode?
ID: 40775
Updated by: [email]tony2001@php.net[/email]
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 [url]http://bugs.debian.org/406264[/url]
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 [url]http://bugs.php.net/?id=40775&edit=1[/url]
tony2001@php.net Guest



Reply With Quote

