[prev in list] [next in list] [prev in thread] [next in thread] 

List:       php-internals
Subject:    Fwd: Re: [PHP-DEV] Function proposal
From:       Petar Nedyalkov <bu () orbitel ! bg>
Date:       2005-05-16 14:06:15
Message-ID: 200505161706.15829.bu () orbitel ! bg
[Download RAW message or body]


On Friday 13 May 2005 14:29, AnteD wrote:
> Hi guys...
>
> Yes I know that this is a small function and yes I know it can be
> copy-paste with every new project you do but from the first day I've
> been using PHP until today this function follows me everywhere and I now
> that everyone is using it one way or the other for debugging......
>
> the problem is when you want to debug a piece of code separately or use
> it in one script then you have to find the function...copy paste to that
> script or write it again just for that script...and so on...it would be
> great if it could be in the php core....
>
> I have a very basic knowledge of C so implementing this function would
> be a nightmare for me but for someone who knows C and the inner
> "mysteries" of the Zend Engine :) this is a piece of cake....
>
> Ok...here it is...don't laugh :)
>
> /**
>   * Prints the variable in HTML format...
>   *
>   * @param mixed $var
>   * @param bool $return return or print the var
>   * @return string
>   */
> function print_pre($var, $return = false) {
> 	$retval =  »<pre> «.print_r($var, true).</pre> «;
> 	if($return) return $retval;
> 	print($retval);
> }

I think the Reflection API is enough and works great for me. Such a basic
debugging is not the issue when speaking of serious projects with a large OO
tree.

Just an opinion.

> ok....let the shooting begin :)

--

Cyberly yours,
Petar Nedyalkov
Devoted Orbitel Fan :-)

PGP ID: 7AE45436
PGP Public Key: http://bu.orbitel.bg/pgp/bu.asc
PGP Fingerprint: 7923 8D52 B145 02E8 6F63 8BDA 2D3F 7C0B 7AE4 5436

[Attachment #3 (application/pgp-signature)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic