[nycphp-talk] Output name of Variable

Chris Shiflett shiflett at
Mon Feb 10 14:14:38 EST 2003

--- Jim Musil <jim at> wrote:
> Why doesn't print_r() just print the name of the
> variable?

For the same reason echo $foo only outputs the value of
$foo. It would be a dangerous assumption to make that
people only use print_r() for debugging and would not mind
the extra output. Plus, as you say, it is trivial to output
the name also, so there is no real advantage and only
disadvantages to such a change.


More information about the talk mailing list