← CodeClarityLab Home
Browse by Category
+ added · updated 7d
✕ Clear A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Scalar Type Declarations (PHP 7.0) PHP 7.0+
PHP 7.0 added int, float, string, bool type declarations for function parameters — the biggest type safety leap in PHP history, enabling static analysis.
2mo ago php beginner
Short Open Tags History & Why to Avoid PHP 3.0+
PHP's short tags (<? ?> and <?= ?>) have been problematic since PHP 3 — disabled by many hosting providers, conflicting with XML, and inconsistent across environments.
2mo ago php beginner
SimpleXML — Parsing XML in PHP PHP 5.0+
SimpleXML provides the fastest way to read well-formed XML in PHP — simplexml_load_string() or simplexml_load_file() returns an object where elements are properties and attributes are array-accessed, requiring no tree traversal.
2mo ago php beginner
Spread Operator & Variadic Args (PHP 5.6) PHP 5.6+
PHP 5.6 added variadic functions (...$args) and argument unpacking ($array...) — replacing func_get_args() and call_user_func_array() with clean syntax.
2mo ago php beginner
sprintf() — Format Strings in PHP PHP 4.0+
sprintf() builds a string by substituting typed placeholders (%s, %d, %f, %05d) with values — safer and more expressive than string concatenation or interpolation for formatted output, especially for numbers, padding, and locale-independent formatting.
2mo ago php beginner
Spaceship Operator <=> (PHP 7.0) PHP 7.0+
The spaceship operator <=> returns -1, 0, or 1 by comparing two values — it replaces verbose if/else comparison callbacks in usort() with a single concise expression.
2mo ago php beginner
Spread Operator in Arrays [...$a, ...$b] PHP 8.1+
PHP 8.1+ allows the spread operator ... inside array literals to merge arrays — cleaner than array_merge() for combining arrays inline.
2mo ago php beginner
str_contains / str_starts_with / str_ends_with PHP 8.0+
PHP 8.0 added str_contains(), str_starts_with(), and str_ends_with() — replace strpos() !== false patterns with these readable alternatives.
2mo ago php beginner
Short Open Tag (<?) PHP 5.0+
Using <? instead of <?php — short tags are disabled by default in many PHP configurations and conflict with XML processing instructions.
2mo ago php beginner
String Offset Curly Brace Syntax PHP 5.0+
Using $str{0} to access string characters by index — deprecated since PHP 7.4 and removed in PHP 8.0; use square bracket syntax $str[0] instead.
2mo ago php beginner
String Interpolation & Heredoc/Nowdoc PHP 5.0+
PHP's double-quoted strings and heredoc syntax interpolate variables; nowdoc is the single-quoted equivalent — each with distinct escaping rules.
2mo ago php beginner
Superglobals ($_GET, $_POST, $_SERVER…) PHP 5.0+
PHP's built-in global arrays that provide access to request data, environment, and server variables — all potentially attacker-controlled.
2mo ago php beginner
✓ schema.org compliant