php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #22495 namespaces cause 'internal compiler error' on includes
Submitted: 2003-03-01 13:36 UTC Modified: 2003-06-10 19:18 UTC
From: andrew at evilwalrus dot com Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 5CVS-2003-03-01 (dev) OS: WinXP
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: andrew at evilwalrus dot com
New email:
PHP Version: OS:

 

 [2003-03-01 13:36 UTC] andrew at evilwalrus dot com
The following script(s) cause an internal compiler error:

----------------- foo.php -----------------
<?php

namespace foo
{
    class bar
    {
        function __construct()
        {
            require_once 'include.php';
        }

        function _debug()
        {
            print $baz;
        }
    }

}

$foo = new foo::bar();
$foo->_debug();

?>

----------------- include.php -----------------
<?php

function fakefunc()
{
    $baz = 'I am foobar!';
}

?>

-----------------------------------------------

Running foo.php via CLI causes the following fatal error to occur:

*Fatal error:  Internal compiler error.  Please report! in include.php on line 6*

Running the script without the 'foo' namespace simply outputs a blank line to the console, with no text returned, and no error generated.

~ Andrew Heebner

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-03-01 13:38 UTC] andrew at evilwalrus dot com
Also, adding $this->baz to _debug() does not help.
 [2003-04-18 20:22 UTC] thekid at thekid dot de
No compiler error here, but this actually won't work anyway. require_once is nothing like "inline" or "#define" in C. It is not as if code was simply at this place instead of in the file:)
 [2003-06-10 19:18 UTC] iliaa@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

namespaces were removed from php5
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat Jul 12 10:01:33 2025 UTC