Bug #17078 Updated: return does not terminate included script
ID: 17078
Updated by: mfischer@php.net
Reported By: kevin.laushway@nlc-bnc.ca
-Status: Open
+Status: Feedback
Bug Type: Scripting Engine problem
Operating System: Dec Alpha OSF1 v5.1
PHP Version: 4.2.0
New Comment:
I'm unable to reproduce this on linux:
$ cat a.php
<?
echo "In file a\n";
$include = include 'b.php';
echo "In file a, after file b returned\n";
?>
$ cat b.php
<?
echo "In file b\n";
return;
echo "Still in file b\n";
?>
$ php-4.0.6 -f a.php
In file a
In file b
In file a, after file b returned
$ php-4.2.1RC2 -f a.php
In file a
In file b
In file a, after file b returned
Can someone test this with those version on win32?
Could this by chance be a configuration issue of your php installation?
Previous Comments:
------------------------------------------------------------------------
[2002-05-07 13:39:26] kevin.laushway@nlc-bnc.ca
A return does not terminate execution of included script.
For Example;
parent.php
<?php
echo "Starting Parent\n";
$m_return = include('./child.php');
echo "Back from Child, return code $m_return\n";
?>
child.php
<?php
echo "Starting Child\n";
return; // this should terminate script
echo "What the heck? I'm still in child\n";
?>
I expect the script to terminate at the return, and "what the heck..."
would never be printed. This functioned as expected in previous
versions. i.e. 4.0.6
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=17078&edit=1
Thread (6 messages)