From: Michal Suchanek Date: 2007-10-20T01:58:36+09:00 Subject: Re: the level of Ruby programmers vs PHP's On 19/10/2007, Daniel DeLorme wrote: > SpringFlowers AutumnMoon wrote: > > i asked the same question on Ruby: how do you write some code to print > > out the variable's name automatically as well as its content. In here, I > > got some helpful discussions and solutions. > > For the record, what was the solution? I can see how you could do it > with eval, both in ruby and php, but beyond that... There is a function in PHP that returns name-indexed array of currently accessible variables or something like that (which is not unlike operating on Ruby bindings for this purpose). This allows to print values of variables by name if you pass in the array and the variable name. Thanks Michal