class MyClass{ public $var0; private $var1; protected $var2; function __construct(){ for($i=0; $i<4; $i++){ $varname = 'var'.$i; if(объявлена($this->$varname)){ print($varname.' here'); }else{ print('there is no '.$varname); } } } }
Conclusion:
var0 here var1 here var2 here there is no var3
Realizable? How?
PS isset did not work for some reason.