php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #733 return in global scope causes parser error
Submitted: 1998-09-10 01:11 UTC Modified: 2000-07-05 02:34 UTC
From: walton at nordicdms dot com Assigned:
Status: Closed Package: Parser error
PHP Version: 3.0.3 OS: FreeBSD 2.2.6
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: walton at nordicdms dot com
New email:
PHP Version: OS:

 

 [1998-09-10 01:11 UTC] walton at nordicdms dot com
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.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-07-05 02:34 UTC] rasmus at cvs dot php dot net
Fixed long ago
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 12:01:30 2024 UTC