php.net |  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 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: rstoll at tutteli dot ch
New email:
PHP Version: OS:

 

 [2013-03-24 15:56 UTC] rstoll at tutteli dot ch
Description:
------------
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


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-03-25 06:36 UTC] laruence@php.net
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] krakjoe@php.net
I concur.
 [2013-03-25 08:11 UTC] krakjoe@php.net
-Status: Open +Status: Not a bug
 [2013-03-25 08:11 UTC] krakjoe@php.net
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-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 13:01:31 2024 UTC