runkit 函数
PHP 手册

runkit_lint

(PECL runkit >= 0.7.0)

runkit_lint Check the PHP syntax of the specified php code

说明

bool runkit_lint ( string $code )

The runkit_lint() function performs a syntax (lint) check on the specified php code testing for scripting errors. This is similar to using php -l from the command line except runkit_lint() accepts actual code rather than a filename.

Note: 对沙盒的支持(是函数 runkit_lint()runkit_lint_file() 和 Runkit_Sandbox 类所必须的)仅在 PHP 5.1 中,或在加过特别补丁的 PHP 5.0 中可用,并需要启用线程安全。请阅读 runkit 包中的 README 文件以了解更多信息。

参数

code

PHP Code to be lint checked

返回值

如果成功则返回 TRUE,失败则返回 FALSE

参见


runkit 函数
PHP 手册