Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

PHP OOP - Destructor

<?php
class Fruit {
  public $name;
  public $color;

  function __construct($name) {
    $this->name = $name;
  }
  function __destruct() {
    echo "The fruit is {$this->name}.";
  }
}

$apple = new Fruit("Apple");
?>
Source by owasp.org #
 
PREVIOUS NEXT
Tagged: #PHP #OOP #Destructor
ADD COMMENT
Topic
Name
9+5 =