From:             [EMAIL PROTECTED]
Operating system: NT/Freebsd
PHP version:      4.0.4pl1
PHP Bug Type:     Scripting Engine problem
Bug description:  Using a return in an included file causes a major abnormality.

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 

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:
return "Hi From";

// 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";

$inc_var = include("");

// According the the documentation,
// this function should not exist..

Edit Bug report at:

PHP Development Mailing List <>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to