Become Zend Certified

Prepare for the ZCE exam using our quizzes (web or iPad/iPhone). More info...

When you're ready get 7.5% off your exam voucher using voucher CJQNOV23 at the Zend Store

Advanced Documentation With Reflection In PHP 5

Article Comments (2 total)

marun, 28 June 2007

This code is no longer valid. Function php_check_syntax() has been removed from PHP since 5.0.5. See:

Stefan Marr, 21 September 2006

Nice article. Live generate documentation, interesting idea. Maybe the Extended Reflection API is something which is useful for this task ( It does parsing of docblocks and enhances the reflection API with a type system. It brings annotations to the PHP world, too.

In your article you mentioned the php_check_syntax() function. But in the current online documentation of this function is marked as deprecated. Did you know any other way to include a php-file with out running it's scripts?

Response from PhpRiot:

It may not be an ideal solution in that it's not natively PHP, but you could perhaps use the command line tool, such as the following:

    $filename = '/path/to/script.php';
    $cmd      = sprintf('/usr/local/bin/php -l %s', escapeshellarg($filename);
    $output = trim(`$cmd`);    

Note the correct usage of backticks, and that you use the correct path to your CLI version of PHP.

Submit a Comment
Use the following form to submit a comment for this article. You can include any required code snippets, which we will format and highlight accordingly.

Note: Before your comment appears on PhpRiot, it must be manually approved. The email address field is optional. If you choose to include it, it will be displayed obfuscated to protect it from spammers.

In This Article