From: Michal Suchanek Date: 2007-10-20T01:19:19+09:00 Subject: Re: the level of Ruby programmers vs PHP's On 19/10/2007, mortee 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. > > > > And this is what happen instead in the PHP newsgroup: > > http://groups.google.com/group/comp.lang.php/browse_thread/thread/e02037a5c14e54c9/3288eeef436b64f7#3288eeef436b64f7 > > Are you currently looking for an answer, or you have already discussed > this, and are just pointing out the difference in answers got here and > on the PHP newsgroup? > They actually gave you a PHP solution that works for variables (with a bit of tweaking). You probably cannot get arbitrary expressions. However, I am not surprised. PHP stands for something like Personal Homepage Preprocessor. Something akin to what awk is for shell scripts, just for the web. People tend to forget about this and try to use it for other stuff. In ruby you can always eval the expression if you do not mind that you either have to pass around a binding or limit yourself to non-local variables. And it's slow. If you want macros then you are out of luck with most scripting languages I guess. Thanks Michal