From:             [EMAIL PROTECTED]
Operating system: Any
PHP version:      4.0.6
PHP Bug Type:     Feature/Change Request
Bug description:  Bad return value from include_once()

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).

Id like include_once() to return 1 or even better, TRUE, if the file was
succesfully included or if its 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 bug report at: http://bugs.php.net/?id=12199&edit=1


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to