mirror of
https://github.com/php/presentations.git
synced 2026-03-24 15:42:33 +01:00
17 lines
391 B
XML
17 lines
391 B
XML
<slide title="Parse Error Detection">
|
|
|
|
<blurb fontsize="4em">
|
|
In PHP 5.0 you don't even need php-cli to validate syntax,
|
|
thanks to the %php_check_syntax()% function.
|
|
</blurb>
|
|
|
|
<example><![CDATA[<?php
|
|
$php_files = glob("*.php");
|
|
foreach ($php_files as $file) {
|
|
if (!php_check_syntax($file, $error)) {
|
|
echo "syntax error '{$error}' inside '{$file}'\n";
|
|
}
|
|
}
|
|
?>]]></example>
|
|
|
|
</slide> |