Combination getter and setter
What do you think, good idea or bad idea?
<?php
class SomeClass
{
public function __call($name, $args)
{
if (isset($args[0])) {
$this->$name = $args[0];
return;
}
return $this->$name;
}
}
Thus you can do:
$user->first_name("justin");
Or:
print $user->first_name();
Kind of reminds me of that song.


1 comment
Braden
Hah, jQuery in PHP. I like it.