note 77218 deleted from function.require-once by cmb
| From: | cmb@php.net | Date: | Wed, 02 Sep 2015 15:22:20 +0000 |
| Subject: | note 77218 deleted from function.require-once by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-203572@lists.php.net to get a copy of this message | ||
Note Submitter: Sinured
----
Beware: As miqrogroove said below, require_once() is not independent of require() -- but vice versa,
require() IS independent of require_once()!
Let's turn miqrogroove's example around:
echo.php
<?php
echo "42!<br />\n";
?>
test.php
<?php
require_once 'echo.php';
require 'echo.php';
// 42!
// 42!
?>
So: require_once() will NOT include a file previously included by require(), while require WILL
include a file previously included by require_once.