ID:               45480
 Updated by:       [EMAIL PROTECTED]
 Reported By:      oka at ping dot uio dot no
 Status:           Open
 Bug Type:         Reproducible crash
 Operating System: Linux
 PHP Version:      5.2.6
 New Comment:

  function print_xml($node, $data) {
        $this->print_xml($node, $data);
  }

is an infinite recursion. You most likely want parent::print_xml($node,
$data);


Previous Comments:
------------------------------------------------------------------------

[2008-07-10 22:38:16] oka at ping dot uio dot no

Description:
------------
Code with a class and a subclass with constructor functions and a
separate function in both classes causes both the Apache 2.0.63 PHP
module and the cli that ships with PHP 5.2.6 to emit the SIGSEGV
signal.


Reproduce code:
---------------
<?
class Article {
  var $ai;
  function Article() {
  }
  function print_xml($node, $data) {
        return "<" . $node . ">" . $data . "</" . $node . ">";
  }
}
class Contribution extends Article {
  function Contribution() {
    $this->Article();
  }
  function print_xml($node, $data) {
        $this->print_xml($node, $data);
  }
}
$contrib = new Contribution();
print $contrib->print_xml("tagname", "New");
?>

Expected result:
----------------
<tagname>New</tagname>


Actual result:
--------------
I put a partial backtrace from gdb 6.4.90-debian online at
http://www.ping.uio.no/~oka/php-5.2.6-oka-SIGSEGV/php-5.2.6-oka-SIGSEGV.gdb-session.log



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=45480&edit=1

Reply via email to