Re: Re: PHP-CLI Debugging Question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jochem Maas wrote:
> Jason Barnett wrote:
>
>> Davy Durham wrote:
>>
>>> No, I was looking for php to print each line of the code as it
>>> executes it.
>>>
>>
>>
>> In that case, you want ob_implicit_flush()
>>
>> http://php.net/manual/en/function.ob-implicit-flush.php
>
>
> I think he is looking to print out the actual line of sourcecode that
> are being run (as in *.phps) - but run it at the same time.

Well, now we're getting into a pretty messy situation.  Because offhand
the first solution that comes to mind is to hack away and extend the
zend engine itself (a la apd or one of the other profilers out there).

Short of doing that, you might be able to hack up a PHP script to do
this step by step.  For this setup you have two PHP scripts:

- The target script (whatever script you want to run line by line)
- The "interpreter" script that reads in the PHP script and prints /
executes line by line

The thing is though, that by the time you get through with this solution
you've rebuilt the PHP interpreter in PHP-user space.  Which just
doesn't make sense.  So if you want the line of source code to go to
output everytime PHP goes to that line of code, then you really should
just extend the PHP engine to do this.  Just ask Rasmus, earlier today
he said it was a piece of cake.  ;)

--
Teach a man to fish...

NEW? | http://www.catb.org/~esr/faqs/smart-questions.html
STFA | http://marc.theaimsgroup.com/?l=php-general&w=2
STFM | http://php.net/manual/en/index.php
STFW | http://www.google.com/search?q=php
LAZY |
http://mycroft.mozdev.org/download.html?name=PHP&submitform=Find+search+plugins

Attachment: signature.asc
Description: OpenPGP digital signature


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux