PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
class foo
{
private $x = 5;
private $y = 13;
public function x($z)
{
$this->{__FUNCTION__} = $z; //Cool
}
public function showx()
{
echo $this->x;
}
}
$foo = new foo();
$foo->showx(); //5
$foo->x(29);
$foo->showx(); //29
$foo->y(16); //PHP gives an error (rightfully so)
This is more a proof of concept but that last $foo->y(); I'd like to capture the fact that they requested a method called "y" and do something with it.... My guess is that this is impossible