NYCPHP Meetup

[nycphp-talk] Output name of Variable

Jim Musil jim at nettmedia.com
Mon Feb 10 14:42:13 EST 2003


Yes, but print_r() already prints out a lot of information. It prints out
the object type and whether it's an array and also all the key names and
object variable names.

What other use for print_r() is there other than to debug?


Jim Musil
<jim at nettmedia.com>
Nettmedia, Senior Developer
345 Seventh Ave., 24th Floor.
New York, NY 10001
Tel. 212.629.0004 x 131


On 2/10/03 2:14 PM, "Chris Shiflett" <shiflett at php.net> wrote:

> --- Jim Musil <jim at nettmedia.com> 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.
> 
> Chris
> 
> 
> --- Unsubscribe at http://nyphp.org/list/ ---
> 
> 




More information about the talk mailing list