php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #43894 Misleading E_WARNING on failed include.
Submitted: 2008-01-19 10:40 UTC Modified: 2008-01-28 23:19 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: sv4php at fmethod dot com Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 5.2.5 OS: Windows XP
Private report: No CVE-ID: None
 [2008-01-19 10:40 UTC] sv4php at fmethod dot com
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 ...

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-01-28 23:19 UTC] tony2001@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Nov 26 01:00:02 2025 UTC