php.net |  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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: chagenbu at wso dot williams dot edu
New email:
PHP Version: OS:

 

 [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:

test.php3:

<?php
include 'class.inc';
require 'class2.inc';
$foo = new Bar2();
echo 'foo';
?>


class.inc:

<?php
class Bar {
  function Bar () {
  }                                                                                                                                                                 
}                                                                                                         ?>


class2.inc:

<?php
class Bar2 extends Bar {
  var $parent;
  function Bar2 () {
    $this->Bar();
  }
}
?>

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

class2.inc 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()...?

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

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-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 18:01:31 2024 UTC