#33732 [Ver->Asn]: behavior of constants in class and interface extending
| From: | johannes@php.net | Date: | Tue, 22 Nov 2005 23:39:00 +0000 |
| Subject: | #33732 [Ver->Asn]: behavior of constants in class and interface extending | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-88741@lists.php.net to get a copy of this message | ||
ID: 33732
Updated by: johannes@php.net
Reported By: lukas dot starecek at centrum dot cz
-Status: Verified
+Status: Assigned
Bug Type: Scripting Engine problem
Operating System: Linux
PHP Version: 5.1CVS-2005-11-23
Assigned To: dmitry
Previous Comments:
------------------------------------------------------------------------
[2005-11-23 00:38:27] johannes@php.net
Dmitry can you check this?
------------------------------------------------------------------------
[2005-11-08 00:40:10] daniel dot gorski at develnet dot org
Is there any chance to fix this before 5.1? Zend is going enterprise
I've heard ...
Please take a look at this issue. I really can not imagine that this is
very hard to implement.
Thank you.
------------------------------------------------------------------------
[2005-10-29 18:38:25] daniel dot gorski at develnet dot org
This bug is _still_ contained in 5.1.0RC4.
regards dtg
------------------------------------------------------------------------
[2005-07-17 10:41:34] lukas dot starecek at centrum dot cz
Description:
------------
If interface define any constants, then it's not possible (due to
error) implement this interface in any class and extend any other class
with this interface.
Reproduce code:
---------------
interface iA {
const cA = 'const of iA';
}
class A implements iA {
}
class B extends A implements iA {
}
$b = new B();
echo iA::cA;
echo A::cA;
echo B::cA;
----- Another example -----
interface iA {
const cA = 'const of iA';
}
class A implements iA {
}
interface iB extends iA {
}
class B extends A implements iB {
}
$b = new B();
echo iA::cA;
echo A::cA;
echo iB::cA;
echo B::cA;
Expected result:
----------------
const of iA
const of iA
const of iA
----- Another example -----
const of iA
const of iA
const of iA
const of iA
Actual result:
--------------
Fatal error: Cannot inherit previously-inherited constant cA from
interface iA
----- Another example -----
Fatal error: Cannot inherit previously-inherited constant cA from
interface iB
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=33732&edit=1