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
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: 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 09:00:02 2026 UTC