note 80128 added to language.variables.variable
| From: | j3nda at fv dot cz | Date: | Sun, 30 Dec 2007 21:23:21 +0000 |
| Subject: | note 80128 added to language.variables.variable | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-134547@lists.php.net to get a copy of this message | ||
hi, i handling multi-array with like this:
i use this for some classes with direct access to $__info array. and i have some config_{set|get}
static functions without this class, but handling is the same.
i'm not testing this piece of code for benchmark and high load.
class __info {
private $__info=array();
public function __s($value=null, $id='')
{
if ($id == '')
return false;
$id='[\''.$id.'\']';
for ($i=2, $max=func_num_args(), $args=func_get_args(); $i<$max; $i++)
$id.='[\''.$args[$i].'\']';
eval('
if (isset($this->__info'.$id.')) {
// debug || vyjimka
}
$this->__info'.$id.'=$value;
');
return true;
}
public function __g($id)
{
$uid='';
for ($i=0, $max=func_num_args(), $args=func_get_args(); $i<$max; $i++)
$uid.="[\'".$args[$i]."\']";
return eval('
if (isset($this->__info'.$uid.')) {
return $this->__info'.$uid.';
} else {
return false;
}
// debug || vyjimka
');
return false;
}
----
Server IP: 147.32.160.17
Probable Submitter: 85.135.87.100
----
Manual Page -- http://www.php.net/manual/en/language.variables.variable.php
Edit -- https://master.php.net/note/edit/80128
Del: integrated -- https://master.php.net/note/delete/80128/integrated
Del: useless -- https://master.php.net/note/delete/80128/useless
Del: bad code -- https://master.php.net/note/delete/80128/bad+code
Del: spam -- https://master.php.net/note/delete/80128/spam
Del: non-english -- https://master.php.net/note/delete/80128/non-english
Del: in docs -- https://master.php.net/note/delete/80128/in+docs
Del: other reasons-- https://master.php.net/note/delete/80128
Reject -- https://master.php.net/note/reject/80128
Search -- https://master.php.net/manage/user-notes.php