Executable Statements (PHP) is one of the source-code metrics Understand computes across 17+ languages — browse them in the GUI, export and track them, or script them with the Python API.
Executable Statements (PHP)
API ID: CountStmtExePhpLanguages: Web
Targets: Architectures, Classes, Files, Project
Number of PHP executable statements.
For example:
<?php
// Compute a visitor count for this session
const SITE_NAME = "Understand Demo";
function nextVisit($count) {
return $count + 1;
}
$visits = 1;
$visits = nextVisit($visits);
echo "You are visitor number " . $visits . " to " . SITE_NAME;
The return statement (6) and the three assignment/output lines ($visits = 1; on 9, $visits = nextVisit($visits); on 10, and the echo statement on 11) are executable, giving CountStmtExePhp = 4.
See Declarative Statements (PHP) for the complementary breakdown, and Executable Statements for the combined count across all languages.
Targets By Language:- Web: Project, File, PHP Class, PHP Interface
- This metric can be disabled from "Project Configuration/Metrics/Lines and Statements" with the "Show statement count metrics" option.
- This metric can be enabled from "Project Configuration/Metrics/Lines and Statements" with the "Breakdown counts by web language" option.