|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-11-12 17:38 UTC] johannes@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 18:00:01 2025 UTC |
Description: ------------ PHP 5.2.4 doesn't provide default class destructor and exits with Fatal error: Call to undefined method base::__destruct() in /path/to/bug.php on line 23 For me coming from Delphi waters this is a bug. If php would provide default class destructor you could write future proof code I think that there is no need to explain what I mean with that especially after reading this in documentation: > Like constructors, parent destructors will not be called implicitly > by the engine. In order to run a parent destructor, one would have > to explicitly call parent::__destruct() in the destructor body. Reproduce code: --------------- error_reporting(E_ALL); $c = new extender(); class base { public function __constructor() { parent::__construct(); } } class extender extends base { public function __constructor() { parent::__construct(); } public function __destruct() { parent::__destruct(); } }