|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-01-11 11:02 UTC] sniper@php.net
[2004-02-04 05:03 UTC] zeev@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 27 22:00:01 2025 UTC |
Description: ------------ If you create two objects which contain a reference to the other object, none of both __destruct() functions will be called. Configure: './configure' '--with-mysql' '--with-xsl' '--with-sqlite' '--enable-sockets' '--with-mysql-sock' '--with-gd' '--with-dom' '--with-apxs2=/usr/sbin/apxs2' '--with-zlib' Reproduce code: --------------- class A { function __construct() { print "Construct A!"; $this->other = new B( $this ); } function __destruct() { print "Destruct A!"; } } class B { function __construct( A $obj ) { print "Construct B!"; $this->other = $obj; } function __destruct() { print "Destruct B!"; } } new A(); Expected result: ---------------- Construct A!Construct B!Destruct A!Destruct B! Actual result: -------------- Construct A!Construct B!