← 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
Safe Mode — What It Was & Why It Failed PHP 3.0+
PHP's safe_mode (PHP 3–5.3) attempted to restrict multi-user PHP hosting at the language level — it was removed in PHP 5.4 after being proven ineffective and breaking legitimate code.
2mo ago php intermediate
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
Socket Programming with PHP PHP 5.0+
PHP supports raw socket programming via the Sockets extension (socket_create) and stream sockets (stream_socket_client) — used for custom protocols, WebSocket servers, and network tools.
2mo ago php advanced
SPL Introduction — Standard PHP Library PHP 5.0+
SPL (Standard PHP Library, PHP 5.0) added data structures, iterators, and interfaces — SplStack, SplQueue, SplHeap, ArrayObject, and the Iterator/Countable interfaces.
2mo ago php intermediate
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
Stack Overflow from Deep Recursion PHP 5.0+
PHP has no configurable stack size limit — deep recursion causes a fatal segfault or memory exhaustion, not a catchable exception.
2mo ago php intermediate
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
SPL Iterators In Depth PHP 5.1+
PHP's Standard PHP Library iterators — SplFileObject, DirectoryIterator, RecursiveIteratorIterator, FilterIterator, and LimitIterator — for memory-efficient file and data traversal.
2mo ago php intermediate
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
serialize() / unserialize() PHP 5.0+
PHP's native serialisation functions can trigger arbitrary code execution via magic methods when deserialising untrusted data.
CWE-502 OWASP A8:2021
2mo ago php intermediate 9.8
session_regenerate_id() PHP 5.0+
Generates a new session ID after login — the primary defence against session fixation attacks.
2mo ago php intermediate
SPL Data Structures PHP 5.3+
PHP's Standard PHP Library provides efficient built-in data structures: SplStack, SplQueue, SplHeap, SplMinHeap, SplDoublyLinkedList, and more.
2mo ago php advanced
Spread Operator (...) PHP 5.6+
Unpacks arrays or traversables into function argument lists or array literals; also used for variadic parameters.
2mo ago php intermediate
Static Methods & Properties PHP 5.0+
Class-level methods and properties that exist independently of any instance — useful for utilities and factories, but harmful when overused.
2mo ago php intermediate
✓ schema.org compliant