Bug #733: return in global scope causes parser error

From: Date: Thu, 10 Sep 1998 05:11:22 +0000
Subject: Bug #733: return in global scope causes parser error
Groups: php.dev 
Request: Send a blank email to php-dev+get-897@lists.php.net to get a copy of this message
From: walton@nordicdms.com Operating system: FreeBSD 2.2.6 PHP version: 3.0.3 PHP Bug Type: Parser error Bug description: Including or requiring a file that looks like this: <? if (defined('MY_INCLUDE_FILE')) { return; } define('MY_INCLUDE_FILE', 1); ... ?> causes a parser error on the last line of the main script if this file is included more than once. The parser error can be silenced by adding one } to the end of the main script for each time that "return" executes. For example, if that file is included 3 times, }} must be added to the end of the script. -- PHP Development Mailing List http://www.php.net/ To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net For help: php-dev-help@lists.php.net

« previous php.dev (#897) next »