26 lines
388 B
PHP
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));
|