class Human{
public function __construct(){ //The constructor class, once instantiated, will be called
echo 'aaa';
}
public function __destruct(){ // The destructor method is called when the object is destroyed
echo 'bbb';
}
public function cc(){
echo '11111';
}
}
$a = new Human();
$a -> cc();
?>
Then the output result is aaa11111bbb
Execution process After the class is instantiated, the constructor is executed first, the ordinary method is executed, and the destructor method is executed