#19151 [Opn->Csd]: Checking for a valid PHP file from PHP

From: Date: Mon, 14 Jun 2004 07:36:08 +0000
Subject: #19151 [Opn->Csd]: Checking for a valid PHP file from PHP
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-60861@lists.php.net to get a copy of this message
ID: 19151 Updated by: magnus@php.net Reported By: markhers at green-ant dot com -Status: Open +Status: Closed Bug Type: Feature/Change Request Operating System: Any PHP Version: 4.2.2 New Comment: Fixed in PHP5. bool php_check_syntax ( string file_name [, string error_message]) Previous Comments: ------------------------------------------------------------------------ [2003-01-29 08:45:02] maxim@php.net I see no reasons why not to have it, especially if something like it was already implemented... Anyone? ------------------------------------------------------------------------ [2002-08-28 10:55:19] markhers at green-ant dot com In the CLI version, you can do: 'php -l {filename}' and find out whether the file you specified is syntactically correct. This would be a powerful feature to be able to call from userland when deciding whether or not to include files based on whether or not they are valid PHP files. I know this is in the Zend area of things, but it would be a very cool addition. In /sapi/cli/php_cli.c, it seems like a trivial function. Before creating a function to submit, or someone beating me to it, is there a good reason NOT to do this? ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=19151&edit=1

« previous php.bugs (#60861) next »