From: sv4php at fmethod dot com
Operating system: Windows XP
PHP version: 5.2.5
PHP Bug Type: *General Issues
Bug description: Misleading E_WARNING on failed include.
Description:
------------
Run the snippet. It should produce two warnings. But the include function
is inexplicably prefixed with my class name.
Reproduce code:
---------------
class MyClass
{
static public function loadCode($p) {
return include $p;
}
}
MyClass::loadCode('I_DO_NOT_EXIST');
Expected result:
----------------
Warning: include(I_DO_NOT_EXIST) [function.include]: failed to open
stream: No such file or directory in ...
Warning: include() [function.include]: Failed opening 'I_DO_NOT_EXIST' for
inclusion (include_path='.;C:\php5\pear') in ...
Actual result:
--------------
Warning: MyClass::include(I_DO_NOT_EXIST) [function.MyClass-include]:
failed to open stream: No such file or directory in ...
Warning: MyClass::include() [function.include]: Failed opening
'I_DO_NOT_EXIST' for inclusion (include_path='.;C:\php5\pear') in ...
--
Edit bug report at http://bugs.php.net/?id=43894&edit=1
--
Try a CVS snapshot (PHP 4.4):
http://bugs.php.net/fix.php?id=43894&r=trysnapshot44
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=43894&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=43894&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=43894&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=43894&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=43894&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=43894&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=43894&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=43894&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=43894&r=support
Expected behavior: http://bugs.php.net/fix.php?id=43894&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=43894&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=43894&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=43894&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=43894&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=43894&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=43894&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=43894&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=43894&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=43894&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=43894&r=mysqlcfg