Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:125703 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by qa.php.net (Postfix) with ESMTPS id D2FE11A00BD for ; Sat, 28 Sep 2024 17:23:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1727544352; bh=M1ai5xw0LnTujyoma2wDRjpX+3UjeR3RadChQpLqZis=; h=Date:Subject:To:References:From:In-Reply-To:From; b=mWLAGigNZzvoZZyG1QSFK2Vp08t34YTO58biPlEy2gdwkFUKJ2WG+Ze0rHoaWmZwy njehSJYZ0XDJW8iknEJsDdpU9mNprFiKq4zPl85GPJABbD6ITCmtAdR5IH9aXagvcB UCLLSi4ocb8iFYEK4yQyF4z3eaFcY2dTMTVB/w0M46eNfcWSEtvAbiHyvEWRrEV0B6 F++Xx3LdMuSzuCCaLhnpb1fka/jHtJK4kn0DsrNpwCV30x3ayehepsKm7zofos0CdX fix2ZwjMvvUSQisjrPnG5Xyali5Mkc8Bh7h+5F2CVE6oaQKr8vaiugFl8XMsZXrhlU MYreZ2ixMv9EQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 63726180076 for ; Sat, 28 Sep 2024 17:25:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,SPF_HELO_PASS, SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from filter101.mijn.host (filter101.mijn.host [5.254.117.213]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Sat, 28 Sep 2024 17:25:49 +0000 (UTC) Received: from h26.mijn.host ([2a03:5180:7:2:f264:726d:beae:1]) by filter101.mijn.host with esmtps (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1subAN-009Ttf-Mn for internals@lists.php.net; Sat, 28 Sep 2024 13:23:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=jnvsor.net; s=x; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:References:To: Subject:MIME-Version:Date:Message-ID:Sender:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=uuX9xLX9FesmNnUIOvWKTLvFQXh+eD/F3aM47t6xprc=; b=vmNluehCS58n3JgdQsKX8srBcu IYhSiiBZi89UPJeowY9j09DuwFDm8mS+X5j1DqnS9gkUF2/egAfCNzMz4U84jMt6ejQrDLFiQY7BM fL5KmicMNxpwfE0B9aex/S6hf+i0h0I4Ow2m7LOR+stee8kfLvhnXQSn8/5YtzQARL4gt3NuJpXtF FPTa6j6Eo60mDGxyrdCdib6Aw6sdbMtMUMFMdJWVoABgZh+ZPNKKRK/EnQSigHdR3S2fgUUP9Miu/ PuXeE0FZfrcY4ye1O9sVdKdyl5SAXK3/iEC7NvbwEi5io8ou4p13e9bS98X1K7jW6mGOPQ3bOGxYT hq5P1X2w==; Received: from 2001-1c00-2a11-3600-8c59-123f-830c-f816.cable.dynamic.v6.ziggo.nl ([2001:1c00:2a11:3600:8c59:123f:830c:f816]) by h26.mijn.host with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.97.1) (envelope-from ) id 1suZIF-0000000F9Gd-0MoK for internals@lists.php.net; Sat, 28 Sep 2024 19:23:35 +0200 Message-ID: Date: Sat, 28 Sep 2024 19:23:35 +0200 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PHP-DEV] Protected destructors To: internals@lists.php.net References: <0a45288d-8ae1-4b1c-8836-6bdd1cf34eb2@gmx.de> Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-AuthUser: jnv@jnvsor.net X-Originating-IP: 2a03:5180:7:2:f264:726d:beae:1 X-mijn.host-Spamfilter-Domain: mijn.host X-mijn.host-Spamfilter-Username: 2a03:5180:7:2:f264:726d:beae:1/112 Authentication-Results: mijn.host; auth=pass smtp.auth=2a03:5180:7:2:f264:726d:beae:1/112@mijn.host X-mijn.host-Spamfilter-Outgoing-Class: ham X-mijn.host-Spamfilter-Outgoing-Evidence: Combined (0.13) X-Recommended-Action: accept X-Filter-ID: Pt3MvcO5N4iKaDQ5O6lkdGlMVN6RH8bjRMzItlySaT8TzrAEJQMIL8nSQ0yQGjDaPUtbdvnXkggZ 3YnVId/Y5jcf0yeVQAvfjHznO7+bT5ysVpdc69k5cRExqclQnUjJ0xCugIxICoR4SK4EpYmU4+fH zJ6mVE7ewsipSVIfs4Zp1F1C+5WupvZhaN5ug+VKABHVTw1lV42ob3hDgXVUNd9a53XVj4zauHkA 5dPfA2liT1v1qMyQrE//74nL7QExJtdY++svJnY40bnF5nHf8sgP0ewai7osuSxLicS7Z0xd1FgH UTYLOfKNI261jSzBP06AR5g2UA3HqsYlcMd+kU3FrKlNunbw3GCGM2ilT87d7j7SBq6MwVj6lFM1 1vq969CCDfOKd5FAllGsCCg+XysEJGdAAQBUErof8jiNd96dw+XGlIW1bb6iLQaqIs5B5d+hLlId aCW6xwdNo4OxtwDY4SpTbUhcsSYcTjOB+M5x3dBtceKX2dWiEm+7oHm9xBEeGmns8QeFADnQDTrf rserYKXCRGR18OfTWrHpf6kV0xJ411PPMPVAmEodS0dereVcnHDGPTHJJ/+YucHWLMPH12Bh87aa 4YfZs104p87OifVovUq7COge14oi3y0trSOIPpeqwlm2NDGXIJ2x7Aw67nLpfFALWaP7S/uCvcMs T3AdBmqsjHpFvIRGv3QGFGGN9tupvM6WO2Ft1gH+FazWxXJEm+6fLO4m0XFhjlYlA5yvuKg/VrQW W0t2gQb8VPATXlXOfRp8+eB3Yg8HXdFEFdiL9rNiZMnOwdYHLGEeFcyQ7VJExC7Q4eRzWD0n0z6b halFEM/pjPCQA+BAlk5KEOURO6sk/Aa437Ns/uqKg2woREVyMtyJFnDS+FlbfUAg3aKvLVJDf9vQ KcSdkWXaLYrRz9GTMdd5i0sa3vXfRmo+6HsrDTfTk2WASpxA9hnDZXV2CQwQLTmDKYV0FLstv/fQ 2PQkRKCR50pYUO1+pvlHhV6a5QjptwQBGybQa79B8ofWhEiU8433QvQjH6EsmgNU80KTDQcWwe0S 4mArfQ+tROiiWG4K9sxAvhAB5OBSN81tpz7T+tfAQe1JK2MgYyDjTfyYIHhsZr9+GI4gfKNLQ72k P6B93hdHavZ5 X-Report-Abuse-To: spam@filter101.mijn.host From: jnv@jnvsor.net (Jonathan Vollebregt) > Okay. My point is that you cannot know (unless there are no circular > dependencies) *when* a destructor is called by the engine; The benefit of non-public visibility isn't when it's called, but how many times it's called. If you can declare your destructor non-public you can be confident it'll only be called once per instance (By the engine) Or is there a scenario where the engine will call a destructor more than once on the same instance? > Destructors should (IMHO) be public. Not necessarily because they can be called, but classes with destructors hint at underlying behavior when destructed. For performance, you might want to defer that by retaining a reference. If a class has a hidden destructor, you have to go read the code to find it. Wouldn't you have to read the code to see if it had a public destructor too?