Req #68951 [NEW]: Function to check file for parse errors.

From: Date: Thu, 29 Jan 2015 19:22:05 +0000
Subject: Req #68951 [NEW]: Function to check file for parse errors.
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-190317@lists.php.net to get a copy of this message
From: mmorris at tombras dot com Operating system: Irrelevant PHP version: Irrelevant Package: Unknown/Other Function Bug Type: Feature/Change Request Bug description:Function to check file for parse errors. Description: ------------ A lot of PHP packages out there run 3rd party code that may contain errors (Wordpress, Drupal, Joomla off the top of my head). It would be very useful to all of them if there was a function that could check a file for parse errors and verify that all proposed function, constant and class names are available for occupation and that they actually exist (although no load would occur, and the autoloader needs to support checking for a class without loading it as it should already do for the existing class_exists() function) without running include or require and finding out that isn't the case with a total system crash. Perhaps include_validate()? Aside from the backwards compatibility problems, I would imagine the engine would have to compile everything twice in order to allow for this, which too large a performance hit to add to the current include and require statements. As separate functions they make sense though. For example, Drupal could use this function to inspect the PHP files of a module during the install process without actually running any of the code, or before running it, and refuse to install a module that can't pass validation. Having a parse error in the middle of the module install process can cause problems. -- Edit bug report at https://bugs.php.net/bug.php?id=68951&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=68951&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=68951&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=68951&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=68951&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=68951&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=68951&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=68951&r=needscript Try newer version: https://bugs.php.net/fix.php?id=68951&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=68951&r=support Expected behavior: https://bugs.php.net/fix.php?id=68951&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=68951&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=68951&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=68951&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=68951&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=68951&r=dst IIS Stability: https://bugs.php.net/fix.php?id=68951&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=68951&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=68951&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=68951&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=68951&r=mysqlcfg

« previous php.bugs (#190317) next »