note 116179 added to oop4.constructor
| From: | Anonymous | Date: | Wed, 19 Nov 2014 10:29:26 +0000 |
| Subject: | note 116179 added to oop4.constructor | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-200950@lists.php.net to get a copy of this message | ||
"There are no destructors in PHP. You may use register_shutdown_function() instead to simulate
most effects of destructors. "
I thought this was a particularly strange statement, seeing as that I use __construct() en
__destruct() the whole time. And surely, from http://php.net/manual/en/language.oop5.decon.php
we can read this:
"void __destruct ( void )
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 there are no other references to a particular
object, or in any order during the shutdown sequence. "
And even:
"The destructor will be called even if script execution is stopped using exit(). Calling exit()
in a destructor will prevent the remaining shutdown routines from executing."
So PHP definitely supports destructors.
----
Server IP: 72.52.91.14
Probable Submitter: 88.159.23.235
----
Manual Page -- http://php.net/manual/en/oop4.constructor.php
Edit -- https://master.php.net/note/edit/116179
Del: integrated -- https://master.php.net/note/delete/116179/integrated
Del: useless -- https://master.php.net/note/delete/116179/useless
Del: bad code -- https://master.php.net/note/delete/116179/bad+code
Del: spam -- https://master.php.net/note/delete/116179/spam
Del: non-english -- https://master.php.net/note/delete/116179/non-english
Del: in docs -- https://master.php.net/note/delete/116179/in+docs
Del: other reasons-- https://master.php.net/note/delete/116179
Reject -- https://master.php.net/note/reject/116179
Search -- https://master.php.net/manage/user-notes.php