|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2001-03-20 20:00 UTC] ceo at phester dot org
[2001-03-20 20:03 UTC] ceo at phester dot org
[2001-03-29 06:26 UTC] stas@php.net
[2001-03-29 07:00 UTC] stas@php.net
[2001-07-15 12:19 UTC] zeev@php.net
[2001-11-29 05:13 UTC] zeev@php.net
[2001-12-14 15:02 UTC] yohgaki@php.net
[2002-07-11 03:23 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Nov 04 17:00:01 2025 UTC |
According to documentation and common sense, using a return inside an include, should end processing on the include and return to processing the script that called it. This is NOT so when functions or classes are declared AFTER the return line. The Following example shows 2 very stange abnormalities and it applies to functions aswell as classes... 1. functions/classes can still be declared AFTER the return line. The Declared function can be executed. 2. If The funtion/class is declared TWICE, it does not print an error. (this hold true to any sort of parse error, except errors withing the classes or functions =) Here's the sample files: ---wierd.inc--- <? return "Hi From wierd.inc..."; // The following should not even be processed... function hello() { global $inc_var; echo $inc_var." 1"; } // redeclaring the function should produce an error message function hello() { global $inc_var; echo $inc_var." 2"; } ?> ---test.php--- <? $inc_var = include("weird.inc"); // According the the documentation, // this function should not exist.. hello(); ?>