All pastes #68347 Raw Edit

Something

public php v1 · immutable
#68347 ·published 2006-06-21 13:19 UTC
rendered paste body
//file cp.phpclass cp {	...		function get_id_cp() {		return $this->id_cp;	}...}//file zone.phpclass zone {...function zone($a_nom_zone=array(),$l_idCp=array()) {		global $LNG;		if(empty($a_nom_zone)) {			foreach ($LNG as $c_lng)				$a_nom_zone[]="";		}		if(count($a_nom_zone)!=count($LNG))			exit("Erreur constructeur zone - LNG != array lng zones");		foreach ($LNG as $c_lng) {			$this->a_nom_zone[$c_lng]=current($a_nom_zone);			next($a_nom_zone);			}		$this->l_idCp=$l_idCp;	}..function get_id_zone() {		return $this->id_zone;	}...}//file zone_cp.phpclass zone_cp {		var $cp;	var $zone;		function zone_cp($zone,$cp) {		global $zone,$cp;		$this->setZone($zone);		$this->setCp($cp);		print_r($this);		echo dirname(__FILE__);		$this->print_();	}function print_() {		echo $this->zone->get_id_zone(); //error here : Call to a member function on a non-object	}	...}//instanciation file.php$zone = & new zone($a_nom_zone);$cp = & new cp($c_val_cp);$zone_cp = & new zone_cp($zone,$cp);