box-o-sand/c&s20150725/demo.php

26 lines
388 B
PHP
Raw Normal View History

2015-07-25 17:53:04 +00:00
<?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));