Return to Snippet

Revision: 32221
at September 21, 2010 07:50 by dmertl


Initial Code
function __call($name, $arguments) {
	if(method_exists($this->Email, $name)) {
		call_user_func_array(array($this->Email,$name),$arguments);
	} else {
		trigger_error('Method '.$name.' does not exist', E_USER_ERROR);
	}
}
function __get($name) {
	if(property_exists($this->Email, $name)) {
		return $this->Email->$name;
	} else {
		trigger_error('Property '.$name.' does not exist', E_USER_ERROR);
	}
}
function __set($name, $value) {
	if(property_exists($this->Email, $name)) {
		$this->Email->$name = $value;
	} else {
		trigger_error('Property '.$name.' does not exist', E_USER_ERROR);
	}
}

Initial URL


Initial Description


Initial Title
PHP forward magic methods

Initial Tags
php

Initial Language
PHP