box-o-sand/oldstuff/c&s20150725/demo.php
2015-07-25 14:41:14 -04:00

26 lines
388 B
PHP

<?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));