Skip to content

Instantly share code, notes, and snippets.

@tigersoldier
Created March 25, 2019 05:53
Show Gist options
  • Save tigersoldier/209f550b3e16affabf66a2c00315f5eb to your computer and use it in GitHub Desktop.
Save tigersoldier/209f550b3e16affabf66a2c00315f5eb to your computer and use it in GitHub Desktop.
Sample PHP code for testing php-ls
<?php
// base class with member properties and methods
class Vegetable {
var $edible;
var $color;
function __construct($edible, $color="green")
{
$this->edible = $edible;
$this->color = $color;
}
function is_edible()
{
return $this->edible;
}
function what_color()
{
return $this->color;
}
} // end of class Vegetable
// extends the base class
class Spinach extends Vegetable {
var $cooked = false;
function __construct()
{
parent::__construct(true, "green");
}
function cook_it()
{
$this->cooked = true;
}
function is_cooked()
{
return $this->
return $this->cooked;
}
} // end of class Spinach
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment