Class destructors : Destructors : Class PHP Source Code


PHP Source Code » Class » Destructors »

 

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");

?>


           
       



HTML code for linking to this page:

Follow Navioo On Twitter

PHP Source Code

 Navioo Class
» Destructors