class A{ var $m; } class B extends A{ function q($w){ $this->_m = $w; return $this->_m; } } $a = new B; echo $a->q(9)*2;