|
Posted by Gary L. Burnore on 10/19/07 00:45
On Fri, 19 Oct 2007 00:16:27 -0000, Summercool
<Summercoolness@gmail.com> wrote:
>On Oct 18, 5:03 pm, "Rik Wasmus" <luiheidsgoe...@hotmail.com> wrote:
>> On Fri, 19 Oct 2007 01:52:42 +0200, Summercool <Summercooln...@gmail.com>
>> wrote:
>>
>> > I wonder in PHP, can you have a function like
>>
>> > print_debug($foo);
>>
>> > and it will print out:
>>
>> > $foo is:
>> > 3
>
>> No, as it's name should be of utter unimportance.
>>
>> (Somewhere in this group there's been given a 'solution' for this about a
>> year ago I think. It involved using debug_backtrace(), fopen()ing the file
>> and reading/parsing the line indicated in that array. Not anything you
>> should want to do.)
>
>Coz in C and in Ruby, they are both possible...
>
>in PHP, maybe you can do something like
>
>print_debug("$foo");
>
>and then define
>
>function print_debug($s) {
> echo $s, "\n";
> print_r(eval($s));
>}
>
>?
>
>but is there something that can work better?
>
print_debug("foo",$foo);
Code print_debug accordingly.
--
gburnore at DataBasix dot Com
---------------------------------------------------------------------------
How you look depends on where you go.
---------------------------------------------------------------------------
Gary L. Burnore | ÝÛ³ºÝ³Þ³ºÝ³³Ýۺݳ޳ºÝ³Ý³Þ³ºÝ³ÝÝÛ³
| ÝÛ³ºÝ³Þ³ºÝ³³Ýۺݳ޳ºÝ³Ý³Þ³ºÝ³ÝÝÛ³
Official .sig, Accept no substitutes. | ÝÛ³ºÝ³Þ³ºÝ³³Ýۺݳ޳ºÝ³Ý³Þ³ºÝ³ÝÝÛ³
| ÝÛ 0 1 7 2 3 / Ý³Þ 3 7 4 9 3 0 Û³
Black Helicopter Repair Services, Ltd.| Official Proof of Purchase
===========================================================================
Navigation:
[Reply to this message]
|