|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #1851 Scripting Engine problem
Submitted: 1999-07-23 15:09 UTC Modified: 1999-07-26 17:17 UTC
From: chagenbu at wso dot williams dot edu Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 4.0 Beta 1 OS: RedHat Linux 6.0
Private report: No CVE-ID: None
 [1999-07-23 15:09 UTC] chagenbu at wso dot williams dot edu
(I sent this to the dev list before, but I haven't heard anything so I figured I'd better do the right thing and enter it in the bugs database)

Ok, this one's a bit bizarre. PHP4 Beta 1, running as an apache module
(1.3.6) on RH 6.0, compiled with imap support.                                                                                                                      
Here's the test script:


include '';
require '';
$foo = new Bar2();
echo 'foo';

class Bar {
  function Bar () {
}                                                                                                         ?>

class Bar2 extends Bar {
  var $parent;
  function Bar2 () {

In php3, this works fine. In php4, I get:
Fatal error: Class bar2: Cannot inherit from undefined class bar in on line 7

If both classes are required, both included, *or* the first required and the
second included, it works fine. It only happens when the include comes first.

Is this unavoidable due to require() being evaluated before parsing the file? But that can't be completely true since you can use a variable as an argument to require()...?


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [1999-07-26 17:17 UTC] zeev at cvs dot php dot net
Fixed - thanks for the detailed report!
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Tue Jun 15 11:01:24 2021 UTC