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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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: Fri Dec 27 03:01:28 2024 UTC