Skip to content

Instantly share code, notes, and snippets.

@cherifGsoul
Created July 29, 2013 21:35
Show Gist options
  • Select an option

  • Save cherifGsoul/6108069 to your computer and use it in GitHub Desktop.

Select an option

Save cherifGsoul/6108069 to your computer and use it in GitHub Desktop.
Setters and getters
public function __get($name)
{
$getter='get'.$name;
if(method_exists($this,$getter))
return $this->$getter();
...
public function __set($name,$value)
{
$setter='set'.$name;
if(method_exists($this,$setter))
return $this->$setter($value);
...............
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment