|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits              [2005-10-29 18:38 UTC] daniel dot gorski at develnet dot org
  [2005-11-08 00:40 UTC] daniel dot gorski at develnet dot org
  [2005-11-23 00:38 UTC] johannes@php.net
  [2005-11-23 10:27 UTC] dmitry@php.net
 | |||||||||||||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 19:00:02 2025 UTC | 
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