PHP 8.5.0 Beta 1 available for testing

Voting

: max(five, zero)?
(Example: nine)

The Note You're Voting On

iwwp at outlook dot com
5 years ago
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

<< Back to user notes page

To Top