[php-maint] Bug#402735: libapache2-mod-php4: Segmentation fault in php4 double free bug?

Matthijs Mohlmann matthijs at cacholong.nl
Sun Jul 22 22:08:10 UTC 2007


Hi,

I'm sorry that I came back to you so late. Here is the piece of code 
that actually causes it:

<?php

class parent2 {

	function parent2() { $this->__construct(); }
	function __construct() {
		// Do something useful.
	}
}

class sub extends parent2 {

	function sub() { $this->__construct(); }
	function __construct() {
		parent::parent();
	}
}

$c = new sub();

?>

The constructor of parent is calling the __construct function. But the 
'this' in parent2 class is actually sub. Which causes a loop.

As far as I can see this is intended behaviour so in my opinion you can 
close the bug.

Regards,

Matthijs Mohlmann




More information about the pkg-php-maint mailing list