This is a cheeky way of doing what you want with the magic methods get and set
<?php
class Dad
{
public static $varPot = array();
function __set($var, $val)
{
self::$varPot[$var] = $val;
}
function __get($var)
{
if (array_key_exists($var, self::$varPot))
{
return self::$varPot[$var];
}
echo "There is nothing for you here called $var<br />";
}
}
class KidA extends Dad
{
public $name = 'Tony';
function foo()
{
echo "FOOOOOOOOOO<br />";
}
}
class KidB extends Dad
{
public $name = 'Spencer';
function bar()
{
echo "BAAAAAAHHHHHH<br />";
}
}
$kid1 = new KidA;
$kid2 = new KidB;
$kid1->like = 'Ice cream<br />';
echo $kid2->like;
$kid2->hate = 'innoculations<br />';
echo $kid1->hate;
?>
You might actually want to set up accessor methods to setting and getting properties if you don't want the PhPolice to come screaming at you wanting to make this more in the spirit of object orientatednessness. And for fun have a play with setting the name property, then echoing. This should teach you something.