All pastes #122558 Raw Edit

Unnamed

public php v1 · immutable
·published 2006-08-08 19:30 UTC
rendered paste body
class myBatch{	// commonly required method put into parent 	// class referencing properties defined in child	public function sumNums()	{             return array_sum($this->nums);	}        public function setNums($nums)        {//validation here             $this->nums=array_merge($this->nums,$nums);        }}class myBatchClientTrustGicPurchase extends myBatch{	// properties specific to the extending class        function __construct() {           $this->setNums(1,5,18);           echo $this->sumNums();        }}class myBatchClientTrustGicPurchase extends myBatch{	// properties specific to the extending class        function __construct() {           $this->setNums(100,9,47);           echo $this->sumNums();        }}