| Bug #7710 | include'ing doesn't work properly | ||||
|---|---|---|---|---|---|
| Submitted: | 9 Nov 2000 1:42am UTC | Modified: | 17 Mar 2001 12:24am UTC | ||
| From: | brozen at torah dot org | Assigned to: | |||
| Status: | Closed | Category: | Documentation problem | ||
| Version: | 4.0.3pl1 | OS: | Linux | ||
[9 Nov 2000 1:42am UTC] brozen at torah dot org
[9 Nov 2000 1:45am UTC] brozen at torah dot org
This bug is also reported at: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=75695
[9 Nov 2000 9:52am UTC] sniper@php.net
Please read this manual page carefully: http://www.php.net/manual/function.require.php --- Changed to Documentation problem as I couldn't find the incompatibilities list (for PHP 3 vs. PHP 4) from the manual. --Jani
[20 Nov 2000 5:28am UTC] brozen at torah dot org
This is not a documentation issue. Read this again before you respond so quickly.
[20 Nov 2000 5:31am UTC] brozen at torah dot org
index.php3:
<? require "header.php3"; ?>
sid is set
<? require "footer.php3"; ?>
header.php3:
<?
if (isset($sid))
{
?>
footer.php3:
<?
}
else
{
echo "sid not set";
}
?>
[25 Nov 2000 9:38am UTC] zeev@php.net
This is in fact a documentation issue. PHP 4.0 changed the behavior of require(), and each separate file must now be parsable by itself. It's a result of a fundemental change that took place between PHP 3 and 4, and this behavior will remain as is... You'd have to find an alternative way of doing what you want (which should be fairly easy). Doc team: The documentation for require() is no longer close to being accurate for PHP 4.0 in general, and PHP 4.0.2&later in particular... It's basically just like include() today, except it can't fail, and would bail out if it does.
[26 Nov 2000 4:01am UTC] brozen at torah dot org
May I ask why this change was made? I was wondering if you could help us find an alternate way -- we couldn't find one -- so please share the knowledge with those who couldn't find it easily like you! ;-) Nonetheless, I can't imagine why functionality like what we're interested in isn't available in PHP. It seems like pretty basic stuff... Thanks.
[17 Mar 2001 12:24am UTC] jmcastagnetto@php.net
change in behavior already documented in manual.
