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
 [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 08:00:01 2026 UTC