1.2.565. Incompilable Files

Files that cannot be compiled, and, as such, be run by PHP. Scripts are linted against various versions of PHP.

This is usually undesirable, as all code must compile before being executed. It may be that such files are not compilable because they are not yet ready for an upcoming PHP version.

Code that is not compilable with older PHP versions means that the code is breaking backward compatibility : good or bad is project decision.

When the code is used as a template for PHP code generation, for example at installation time, it is recommended to use a distinct file extension, so as to distinguish them from actual PHP code.

<?php

// Can't compile this : Print only accepts one argument
print $a, $b, $c;

?>

1.2.565.1. Suggestions

  • If this file is a template for PHP code, change the extension to something else than .php

  • Fix the syntax so it works with various versions of PHP

1.2.565.2. Specs

Short name

Php/Incompilable

Rulesets

All, Analyze, Appinfo, CE

Exakat since

0.8.4

PHP Version

All

Severity

Critical

Time To Fix

Slow (1 hour)

Precision

Very high

ClearPHP

no-incompilable

Examples

xataface

Available in

Entreprise Edition, Community Edition, Exakat Cloud