Patch for __destruct page
| From: | Rob Allen | Date: | Fri, 16 Sep 2011 22:23:20 +0000 |
| Subject: | Patch for __destruct page | ||
| Groups: | php.doc | ||
| Request: | Send a blank email to phpdoc+get-969383216@lists.php.net to get a copy of this message | ||
Hi,
Please find attached a patch for http://uk3.php.net/__destruct to hopefully make it a little
clearer.
I tried to use edit.php.net, but it told me that this file had been modified by "Anonymous
#2095", so I couldn't save it there.
In case the attachment doesn't work, the diff text is:
Index: language/oop5/decon.xml
===================================================================
--- language/oop5/decon.xml (revision 316864)
+++ language/oop5/decon.xml (working copy)
@@ -94,8 +94,9 @@
<para>
PHP 5 introduces a destructor concept similar to that of other
object-oriented languages, such as C++. The destructor method will be
- called as soon as all references to a particular object are removed or when
- the object is explicitly destroyed or in any order in shutdown sequence.
+ called as soon as there are no other references to a particular object
+ when that object is explicitly destroyed, or in any order during the
+ shutdown sequence.
</para>
<example>
<title>Destructor Example</title>
Basically, the current text implies that explicitly destroying the object will call __destruct()
regardless of whether there are any other references to it, which is not how it works as unset()
will only call __destruct() if there are no other references to the object.
Regards,
Rob…
Index: language/oop5/decon.xml =================================================================== --- language/oop5/decon.xml (revision 316864) +++ language/oop5/decon.xml (working copy) @@ -94,8 +94,9 @@ <para> PHP 5 introduces a destructor concept similar to that of other object-oriented languages, such as C++. The destructor method will be - called as soon as all references to a particular object are removed or when - the object is explicitly destroyed or in any order in shutdown sequence. + called as soon as there are no other references to a particular object + when that object is explicitly destroyed, or in any order during the + shutdown sequence. </para> <example> <title>Destructor Example</title>
Index: language/oop5/decon.xml =================================================================== --- language/oop5/decon.xml (revision 316864) +++ language/oop5/decon.xml (working copy) @@ -94,8 +94,9 @@ <para> PHP 5 introduces a destructor concept similar to that of other object-oriented languages, such as C++. The destructor method will be - called as soon as all references to a particular object are removed or when - the object is explicitly destroyed or in any order in shutdown sequence. + called as soon as there are no other references to a particular object + when that object is explicitly destroyed, or in any order during the + shutdown sequence. </para> <example> <title>Destructor Example</title>