|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2001-08-08 10:22 UTC] marten at ditt dot as
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 20:00:01 2025 UTC |
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"; } ?>