|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2008-07-10 22:38 UTC] 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
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 16:00:01 2025 UTC |
function print_xml($node, $data) { $this->print_xml($node, $data); } is an infinite recursion. You most likely want parent::print_xml($node, $data);