Edit report at https://bugs.php.net/bug.php?id=64504&edit=1

 ID:                 64504
 Comment by:         rstoll at tutteli dot ch
 Reported by:        rstoll at tutteli dot ch
 Summary:            Forward reference of a class with interface
 Status:             Not a bug
 Type:               Bug
 Package:            Class/Object related
 PHP Version:        5.4.13
 Block user comment: N
 Private report:     N

 New Comment:

And I thought PHP supports forward references. Well, well... learned something 
new.


Previous Comments:
------------------------------------------------------------------------
[2013-03-25 08:11:30] krak...@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 08:10:43] krak...@php.net

I concur.

------------------------------------------------------------------------
[2013-03-25 06:36:50] larue...@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-24 15:56:15] 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



------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=64504&edit=1

Reply via email to