Merge
This commit is contained in:
commit
7e812d6bfc
3 changed files with 756 additions and 273 deletions
976
package-lock.json
generated
976
package-lock.json
generated
File diff suppressed because it is too large
Load diff
Binary file not shown.
53
test/source.php
vendored
53
test/source.php
vendored
|
@ -2,3 +2,56 @@
|
|||
/**
|
||||
function hello($world) {}
|
||||
*/
|
||||
|
||||
// base class with member properties and methods
|
||||
class Vegetable {
|
||||
|
||||
var $edible;
|
||||
var $color;
|
||||
|
||||
Something::class;
|
||||
SomeThing::class;
|
||||
|
||||
function Vegetable($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 Spinach()
|
||||
{
|
||||
$this->Vegetable(true, "green");
|
||||
}
|
||||
|
||||
function cook_it()
|
||||
{
|
||||
$this->cooked = true;
|
||||
}
|
||||
|
||||
function is_cooked()
|
||||
{
|
||||
return $this->cooked;
|
||||
}
|
||||
|
||||
} // end of class Spinach
|
||||
|
||||
?>
|
||||
|
||||
|
|
Loading…
Reference in a new issue