Re: Tool to parse and validate PHP script?
Jerry Stuckle wrote:
> Sir Robin wrote:
>> On Thu, 08 May 2008 17:22:59 -0400, sheldonlg <sheldonlg> wrote:
>>
>>> Gilles Ganault wrote:
>>>> Hello
>>>>
>>>> Is there a tool on Linux/FreeBSD that can parse a PHP script to
>>>> make
>>>> sure there's no compile-time issues?
>>> You will never have a compile-time error with PHP since PHP is a
>>> script and, hence, doesn't compile. Perhaps you mean run-time issues?
>>
>> As far as I understand PHP does in fact first compile the script to
>> byte-code
>> and then run it... Surely if the code has syntax errors it would
>> result to
>> compile time error, right?
>>
>
> No, Gilles is correct. PHP is not compiled. It is interpreted. A big
> difference. And no, syntax errors are not considered compile-time errors.
>
> Java, OTOH, is compiled to byte code.
>
Jerry, that was me -- not Gilles -- who said it....but thanks for
agreeing. Robin, by compile time we mean generating code without
running the code. That is what we mean by a differentiation between
compile time errors and run time errors. The former does syntax
checking, etc. and the bugs are an order of magnitude easier to find
than run time bugs. An interpreted language, like PHP, doesn't have a
compiler.
|