All pastes #25431 Raw Edit

Someone

public text v1 · immutable
#25431 ·published 2005-10-13 22:20 UTC
rendered paste body
	function __call($method, $arguments) {
		$prefix = strtolower(substr($method, 0, 3));
		$property = strtolower(substr($method, 3));

		if (empty($prefix) || empty($property)) {
			return;
		}

		if ($prefix == "get" && isset($this->$property)) {
			return $this->$property;
		}

		if ($prefix == "set") {
			$this->$property = $arguments[0];
		}
	}