|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
  [2001-08-11 19:24 UTC] stephan dot skusa at lippe-net dot de
 On Linux this has the same behaviour even if you replace
$this-> reference by parent:: or A::, B:: references:
class A extends X
{
      function A() { X::X(); }
      function crash_me() { echo "CRASHME A<br>\n"; }
}
class B extends A
{
      function B() { A::A(); }
  
      function crash_me() { echo "CRASHME B<br>\n"; parent::crash_me(); }
}
class C extends B
{
      function C() { B::B(); }
}
$r = new C();
$r->crash_me();
echoes lots of CRASHME B ... but not any CRASHME A ...
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             | |||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 09:00:01 2025 UTC | 
Works for me fine with PHP 4.1.0RC1: <?php class X { function X() { } } class A extends X { function A() { X::X(); } function crash_me() { echo "CRASHME A<br>\n"; } } class B extends A { function B() { A::A(); } function crash_me() { echo "CRASHME B<br>\n"; parent::crash_me(); } } class C extends B { function C() { B::B(); } } $r = new C(); $r->crash_me(); ?>