php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #12703 Refering to BUG# 12560
Submitted: 2001-08-11 19:24 UTC Modified: 2001-10-21 20:16 UTC
From: stephan dot skusa at lippe-net dot de Assigned:
Status: Closed Package: Class/Object related
PHP Version: 4.0.6 OS: Linux
Private report: No CVE-ID: None
 [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 ...

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-10-21 20:16 UTC] sniper@php.net
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();

?>

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Dec 30 17:01:29 2024 UTC