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
 [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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 04:01:30 2024 UTC