>>4
disregard that i suck cocks.
what does print_r?
Name:
Anonymous2007-06-15 4:18 ID:uVq2/jlm
>>1
Why would you want that? Variables are just references to objects in memory. All objects are anonymous; names only exist for variables which reference them. Tell me what are you trying to do, and I'll tell you why it's wrong.
>>4
It's similar to Python's pprint. It prints something in a nice way, and it's useful to display dictionaries for debugging. Objects are printed like dictionaries, using their properties.
Name:
Anonymous2007-06-15 4:24 ID:tzFnpbeJ
>>4 >>5
Instead of writing these two posts you could have typed php.net/print_r 4.9 times.
mmm
can't you do a function similar to print_r, called something like
print_r2("myTable")
which would assign to the variable myTable the name myTable, then print it out with print_r ?
Name:
Anonymous2007-06-16 9:26 ID:PUlDQAHz
Sure you can, although I'm not sure if you get what I'm saying. I'm not handing you code on a plate, I'm pointing out that it's possible to have the name of a variable and use that to get the value of a variable, so you don't need to use the name twice in something like dumpFunc("foo", $foo) which seems to be what you're trying to avoid.
% cat x.php
<?
class Foo {
function Foo() {
$this->value = 42;
}
function get() {
return $this->value;
}
}