Class Destructors

 
    <?php
   class Book
   {
      private $title;
      private $isbn;
      private $copies;      function __construct($isbn)
      {
         echo "<p>Book class instance created.</p>";
      }      function __destruct()
      {
         echo "<p>Book class instance destroyed.</p>";
      }
   }   $book = new Book("1111");?>

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.