note 84108 deleted from function.include-once by salathe
| From: | salathe@php.net | Date: | Mon, 21 Sep 2020 14:41:52 +0000 |
| Subject: | note 84108 deleted from function.include-once by salathe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-215271@lists.php.net to get a copy of this message | ||
Note Submitter: roach dot scott+spam at googlemail dot com
----
If you include a file that does not exist with include_once, the return result will be false.
If you try to include that same file again with include_once the return value will be true.
Example:
<?php
var_dump(include_once 'fakefile.ext'); // bool(false)
var_dump(include_once 'fakefile.ext'); // bool(true)
?>
This is because according to php the file was already included once (even though it does not exist).