php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #40965 constructor executing aborted
Submitted: 2007-03-30 22:12 UTC Modified: 2007-03-31 06:25 UTC
From: gabor dot toth at prolabor dot hu Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 5.2.1 OS: irrevelant
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: gabor dot toth at prolabor dot hu
New email:
PHP Version: OS:

 

 [2007-03-30 22:12 UTC] gabor dot toth at prolabor dot hu
Description:
------------
Source code doesn't run. I've tried it in my XP width apache 2.2 and php 5.2.1, and on a linux server with apache 2.0 and php 4.4.0

I have known about this bug long time, but now i managed to repoduce it.

As you see derived class constructor calls super constructor, these class made to compatible width php 4 and 5.


Reproduce code:
---------------
class Super {
	function Super() { $this->__construct(); }

	function __construct() { echo "Super\n"; }
}

class Derived extends Super {
	function __construct() { $this->Derived(); }

	function Derived() { parent::Super(); echo "Derived"; }
}

$a = new Derived();


Expected result:
----------------
Super
Derived

Actual result:
--------------
nothing at all.
apache log:

Parent: child process exited with status 3221225477 -- Restarting. 


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-03-31 06:25 UTC] mike@php.net
This generates an endless loop.
Either use self::__construct() or don't write such senseless code.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Jul 13 13:01:32 2025 UTC