How to get an identity of a variable?
Posted: Mon Jun 09, 2003 6:52 am
I´d like to pass a variable by reference to a function, which is supposed to 'identify' the variable (perhaps by memory-location or something) and save the value and this identifier in an array.
Does anybody have any ideas ??
Code: Select all
<?php
function logVar(& $var) {
$id = getIdentifier($var) // ???
if ( is_array($this->elements[$id]) ) { // identifier already exist
$this->elements[$id][] = $var;
} else {
$this->elements[$id] = array($var);
}
}
?>