php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #22503 classes have to be defined before they can be used
Submitted: 2003-03-02 05:07 UTC Modified: 2003-06-03 15:58 UTC
From: sander@php.net Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 5CVS-2003-03-02 (dev) OS: Debian Linux (unstable)
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: sander@php.net
New email:
PHP Version: OS:

 

 [2003-03-02 05:07 UTC] sander@php.net
The following snippet works fine on ZE1, but gives "Fatal error: Class 'foo' not found" on ZE2. Classes apparently need to be defined before they can be used.

  $bar = new foo();
  class foo {}

Although it's easy to work around this problem, it breaks BC.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-06-03 15:58 UTC] sterling@php.net
yep, this is a known bc break.  its intentional, and here to stay.
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Wed Feb 04 10:00:01 2026 UTC