note 124619 added to language.oop5.decon
| From: | iwwp at outlook dot com | Date: | Thu, 16 Jan 2020 07:58:03 +0000 |
| Subject: | note 124619 added to language.oop5.decon | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-213887@lists.php.net to get a copy of this message | ||
To better understand the __destrust method:
class A {
protected $id;
public function __construct($id)
{
$this->id = $id;
echo "construct {$this->id}\n";
}
public function __destruct()
{
echo "destruct {$this->id}\n";
}
}
$a = new A(1);
echo "-------------\n";
$aa = new A(2);
echo "=============\n";
The output content:
construct 1
-------------
construct 2
=============
destruct 2
destruct 1
----
Server IP: 45.112.84.4
Probable Submitter: 185.85.3.168 (proxied: 116.247.109.58)
----
Manual Page -- http://php.net/manual/en/language.oop5.decon.php
Edit -- https://master.php.net/note/edit/124619
Del: integrated -- https://master.php.net/note/delete/124619/integrated
Del: useless -- https://master.php.net/note/delete/124619/useless
Del: bad code -- https://master.php.net/note/delete/124619/bad+code
Del: spam -- https://master.php.net/note/delete/124619/spam
Del: non-english -- https://master.php.net/note/delete/124619/non-english
Del: in docs -- https://master.php.net/note/delete/124619/in+docs
Del: other reasons-- https://master.php.net/note/delete/124619
Reject -- https://master.php.net/note/reject/124619
Search -- https://master.php.net/manage/user-notes.php