|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2011-02-18 13:22 UTC] cataphract@php.net
-Status: Open
+Status: Bogus
[2011-02-18 13:22 UTC] cataphract@php.net
[2011-02-18 20:38 UTC] jballard at natoga dot com
[2011-02-18 20:41 UTC] jballard at natoga dot com
[2011-02-20 08:43 UTC] anon at anon dot anon
[2011-02-20 16:46 UTC] rasmus@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 22:00:01 2025 UTC |
Description: ------------ PHP Version: 5.3.2-1ubuntu4.7 When using an include() statement within an if statement, PHP always fails with a seemingly blank input. However, when used normally (obviously) it works fine, and when assigning the return value to a variable and then testing the value of the variable, include() works as intended. Something that may or may not be a factor in this bug is that I have appended to the default include path; however, logically in all test cases (both in the actual project and the test script to create this bug report) this seems irrelevant to the bug. Test script: --------------- <?php /* $v = include_once("blank.php"); if(!$v) echo "FAILED"; else echo "SUCCESS"; */ if( include_once("blank.php") != true) echo "FAILED"; else echo "SUCCESS"; ?> Expected result: ---------------- As is, the script should run just like a normal function; why it behaves in this matter only within in an if-then statement is the bug. The script above -should- output FAILED if there is not a script entitled "blank.php", and SUCCESS if there is. Actual result: -------------- The script above, as-is, believes there is a blank string being inputted into the include() call, when in reality there is a perfectly valid filename. If you comment out the second half of the script and uncomment the first part, it works perfectly fine. Error message: Warning: include_once(/natoga/website/www/dev) [function.include-once]: failed to open stream: Not a directory in /natoga/website/www/dev/includeoncebug.php on line 10 Warning: include_once() [function.include]: Failed opening '' for inclusion (include_path='.:/usr/share/php:/usr/share/pear:/natoga/website/www/res') in /natoga/website/www/dev/includeoncebug.php on line 10