Reply to Re: strict checks with php -l

Your name:

Reply:


Posted by Hilarion on 07/11/05 13:01

Cristian Gutierrez wrote:

> Is there any way to trigger "undefined variable/constant" error notices
> when running `php -l' over a source file? Or even better, when using
> php_check_syntax() over the file?

AFAIK no.


> So far I've noticed that I only get those errors when actually *running*
> the script, and I'm beggining to suspect there's little more (if at all)
> to do without getting dirty with a PHP language parser. For example,
> when I run the following script:
> [...]

Those notice messages are only available on runtime cause only
then one can check for sure if some variable was set (or some constant
was defined). Those notices have nothing to do with syntax.

For example your "testerr.php" script could be included by other
script which would (prior to including) set value of variable $a and
define constant "a", so there would be no notices.


Hilarion

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация