No, it doesn't.
I want to save the variable-name and it´s value only by giving the variable to the function by reference.
Then I can call that function, which is a member of a class, again and can save all different values the variable gets in the script.
The destructor prints all these variable-names and their different values.
Code: Select all
<?php
$L = new Log();
$var = "Hi";
$L->logVar($var);
$var .= " user!";
$L->logVar($var);
?>
Instead of
Code: Select all
<?php
$L = new Log();
$var = "Hi";
$L->logVar('var', $var);
$var .= " user!";
$L->logVar('var', $var);
?>