Move the C&S thing into the attic
This commit is contained in:
25
oldstuff/c&s20150725/demo.php
Normal file
25
oldstuff/c&s20150725/demo.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
class Person {
|
||||
public $name;
|
||||
|
||||
public function wave()
|
||||
{
|
||||
return $this->name. ' is waving';
|
||||
}
|
||||
|
||||
public function waveAt(Person $waveTarget)
|
||||
{
|
||||
return $this->name . ' waves at ' . $waveTarget->name;
|
||||
}
|
||||
}
|
||||
|
||||
$boo = new Person();
|
||||
$boo->name = 'Boo';
|
||||
var_dump($boo->wave());
|
||||
|
||||
$hay = new Person();
|
||||
$hay->name = 'Hay';
|
||||
var_dump($hay->wave());
|
||||
|
||||
var_dump($boo->waveAt($hay));
|
Reference in New Issue
Block a user