Bug #12199 Updated: Bad return value from include_once()
| From: | marten at ditt dot as | Date: | Wed, 08 Aug 2001 14:23:01 +0000 |
| Subject: | Bug #12199 Updated: Bad return value from include_once() | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-62559@lists.php.net to get a copy of this message | ||
ID: 12199
User updated by: marten@ditt.as
Reported By: marten@ditt.as
Old Status: Open
Status: Closed
Bug Type: Feature/Change Request
Operating System: Any
PHP Version: 4.0.6
New Comment:
Fixed in CVS by Zeev on August 2. Thanks!
Previous Comments:
------------------------------------------------------------------------
[2001-07-17 05:51:50] marten@ditt.as
Currently include_once() returns 1 the first time a file is included and NULL the second time (when
the file is already included) but NULL is also returned if an error occurs when including the file
(file not found, parse error etc).
I´d like include_once() to return 1 or even better, TRUE, if the file was succesfully included or
if it´s already included and FALSE if an error occured.
<?php
// Returns 1, evaluates to TRUE
if(include_once('myfile.php')) {
echo "SUCCESS\n";
}
else {
echo "FAILURE\n";
}
// Returns NULL, evaluates to FALSE
if(include_once('myfile.php')) {
echo "SUCCESS\n";
}
else {
echo "FAILURE\n";
}
?>
------------------------------------------------------------------------
Edit this bug report at http://bugs.php.net/?id=12199&edit=1