Page 1 of 1

Get all $vars from a function()

Posted: Sun Jan 25, 2004 5:14 pm
by Gen-ik
Does anyone know if it's possible to get a list of all the variables in a function() regardless of if they were predefined of dynamically created?

Code: Select all

<?php
// An example.

function EatVars()
{
    $a = "apple";
    $b = "banana";
    ${$a} = "{$a} pie";
}

$allVars = somehow_get_all_vars_from_EatVars_into_an_array;

echo count($allVars);
?>
It would be very handy to know.