PHP 4.0 Bug #7756: Problems w/include ""
| From: | bens at benjamindsmith dot com | Date: | Sat, 11 Nov 2000 05:47:57 +0000 |
| Subject: | PHP 4.0 Bug #7756: Problems w/include "" | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-37726@lists.php.net to get a copy of this message | ||
From: bens@benjamindsmith.com
Operating system: RH 6.2
PHP version: 4.0.3pl1
PHP Bug Type: *Function Specific
Bug description: Problems w/include ""
Executing the following code
<?
$a="";
if (false===include ($a))
{
echo "Couldn't include file";
// error handling
}
else
{
echo "file found!";
// all is well...
}
?>
causes the script to crash instead of allowing me to trap the error. This could be fixed with a
simple input sanity check in the include function!
I see that you've already seen this bug in a different form http://bugs.php.net/bugs.php?id=6743 but this
didn't address the problem given here.
Include is a function like any other, and if it fails, the script shouldn't cause all action to
stop. It, like any other function, should return false and should be trapable in the code above.
Thanks!
-Ben
--
Edit Bug report at: http://bugs.php.net/?id=7756&edit=1