Declarative 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.
Declarative Statements (PHP)
| API ID | CountStmtDeclPhp |
| Targets | Architectures Classes Files Project |
| Languages | Web |
| Categories | Statements |
| Cost | Lookup |
| Tags | Web Breakdown |
Number of PHP declarative 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;
const SITE_NAME = "Understand Demo"; (3) and function nextVisit($count) { ... } (5) are the two declarations, giving CountStmtDeclPhp = 2.
See Executable Statements (PHP) for the complementary breakdown, and Declarative Statements for the combined count across all languages.
Targets By Language:- Web: Project, File, PHP Class, PHP Interface