|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #64504 Forward reference of a class with interface
Submitted: 2013-03-24 15:56 UTC Modified: 2013-03-25 08:11 UTC
From: rstoll at tutteli dot ch Assigned:
Status: Not a bug Package: Class/Object related
PHP Version: 5.4.13 OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: rstoll at tutteli dot ch
New email:
PHP Version: OS:


 [2013-03-24 15:56 UTC] rstoll at tutteli dot ch
My PHP version is 5.4.7

forward references of classes do not work if the class implements an interface.

Test script:
$a = new Ok(); //that's ok

class OK{}

$a = new Fail(); //fails

interface I{}
class Fail implements I{}

Expected result:
I would expect that forward references are also supported for classes which implement an interface


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2013-03-25 06:36 UTC]
always declare before use(or use autoload mechanism)...

this is the current implementation, I don't think it's need to be fixed.
 [2013-03-25 08:10 UTC]
I concur.
 [2013-03-25 08:11 UTC]
-Status: Open +Status: Not a bug
 [2013-03-25 08:11 UTC]
Closing as not a bug, before it gets lost to time and becomes another number in a 
stack of non-bugs.
 [2013-03-25 10:42 UTC] rstoll at tutteli dot ch
And I thought PHP supports forward references. Well, well... learned something new.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sun Dec 03 13:01:27 2023 UTC