All pastes #812476 Raw Edit

ww

public php v1 · immutable
·published 2007-12-11 20:15 UTC
rendered paste body
<?phpclass Attributes {	static $honesty = 1;}class Person {	private $attributes;	public function getAttr($attr) {		if(isset($this->attributes[$attr])) {			return $this->attributes[$attr];		} else {			return null;		}	}	public function setAttr($attr, $value) {		$this->attributes[$attr] = $value;	}}class WhiteWolf extends Person {	public function __construct() {		$this->setAttr(Attributes::$honesty, 10); //some arbitrary value	}}$ww = new WhiteWolf;$ww->setAttr(Attributes::$honesty, $ww->getAttr(Attributes::$honesty) - 1);