PHP magic method _ construct _ destruct (1), phpdestruct. PHP magic method _ construct _ destruct (1), phpdestruct slowly night searching, bright moon hanging _ construct () -call this method _ destruct ()-PHP magic method of the object _ construct _ destruct (1) and phpdestruct every time you create a new object.
Long night searching, bright moon hanging
_ Construct ()-call this method every time a new object is created
_ Destruct ()-all references to an object are deleted or executed when the object is explicitly destroyed.
'; Var_dump (self ::$ link); mysql_close (self ::$ link); var_dump (self ::$ link );}} $ mysql = new Example ('localhost', 'root', 'root', 'test ');
Result:
resource(2) of type (mysql link)resource(2) of type (Unknown)
Http://www.bkjia.com/PHPjc/916824.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/916824.htmlTechArticlePHP magic method _ construct _ destruct (a), phpdestruct slowly night searching, bright moon hanging _ construct () -call this method _ destruct ()-object's location first when creating a new object...