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
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: stephan dot skusa at lippe-net dot de
New email:
PHP Version: OS:

 

 [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: Sat Dec 21 15:01:29 2024 UTC