Skip to content

Instantly share code, notes, and snippets.

@ackintosh
Created November 25, 2012 04:58
Show Gist options
  • Save ackintosh/4142451 to your computer and use it in GitHub Desktop.
Save ackintosh/4142451 to your computer and use it in GitHub Desktop.
Using the __call()
class Wrapper
{
private $_obj;
public function __construct($obj)
{
$this->_obj = $obj;
}
public function __call($name, $args)
{
$result = call_user_func_array(array($this->_obj, $name), $args);
if ($result === false) {
echo 'error occured';
}
return $result;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment