Re: POO y variables... ¿ocultas?

From: Date: Mon, 12 Feb 2007 21:07:34 +0000
Subject: Re: POO y variables... ¿ocultas?
References: 1  Groups: php.general.es 
Request: Send a blank email to general-es+get-60413@lists.php.net to get a copy of this message
Javier Martinez wrote:
En un objeto, existe alguna forma de declarar las variables para que al hacer un print_f no me aparezcan? Gracias Hola Javier,
A que te refieres que no te aparezcan con print_f?. Que yo sepa en un objeto puedes declarar una variable de tres formas (PHP5) pirvate, public y protected (ademas hay las estaticas). Si deseas sacar el valor de una variable o utilizarla bueno pues entonces lo haces $this->var; /** * Class test */ class test{ public $var; function useVarInFunc(){
      echo $this->var;
} function getVarOutside(){
      return $this->var;
} } $this->saludos." - ".$this->carlos

« previous php.general.es (#60413) next »