note 26923 rejected from keyword.paamayim-nekudotayim by nicos

From: Date: Mon, 18 Nov 2002 02:20:15 +0000
Subject: note 26923 rejected from keyword.paamayim-nekudotayim by nicos
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-39614@lists.php.net to get a copy of this message
You can implement a getter/setter pair to emulate a class variable. The syntax isn't so weird: <? class A{ function getVar($val=NULL){ static $class_variable = 0; if($val != NULL){ $class_variable = $val; } return $class_variable; } function setVar($val=0){ return A::getVar($val); } } A::setVar(3); print A::getVar(); ?>

« previous php.notes (#39614) next »