Result Size: 625 x 571
x
 
<!DOCTYPE html>
<html>
<body>
<?php
class Fruit {
  // Properties
  public $name;
  public $color;
  // Methods
  function set_name($name) {
    $this->name = $name;
  }
  function get_name() {
    return $this->name;
  }
}
$apple = new Fruit();
var_dump($apple instanceof Fruit);
?>
 
</body>
<!-- Mirrored from www.w3schools.com/php/phptryit.asp?filename=tryphp_class4 by HTTrack Website Copier/3.x [XR&CO'2014], Mon, 27 Jan 2020 02:50:49 GMT -->
</html>
×

Report a Problem: