Construct/Destruct

In PHP 5, the __construct() method will be called (if it exists) when the object is created, and the __destruct() method when it is destroyed.

<?php
class foo {
    var $bar;

    function __construct($val) {
        $this->bar = $val;
    }

    function __destruct() {
        unset($this->bar);
    }
}
?>

Loading ...

Related Results :

  1. Construct/Destruct
Note :
  • Related Posts are generally User Blog posts.
  • or Other tutorials from other networks of w3clan.com.
  • Any registered user can create related posts based on search term tags.

About the Author