← Home ← Codex ← DEBT
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
each() & list() — Deprecated Iteration PHP 3.0+
each() was deprecated in PHP 7.2 and removed in PHP 8 — replace while(list($k,$v)=each($arr)) with foreach. list() itself is still valid as [] destructuring.
3mo ago PHP beginner
Engine Exceptions — Error Hierarchy (PHP 7.0) PHP 7.0+
PHP 7.0 made fatal engine errors catchable as Error subclasses — TypeError, ParseError, ArithmeticError, DivisionByZeroError — via the shared Throwable interface.
3mo ago PHP intermediate
Enums — First-Class Enumerations (PHP 8.1) PHP 8.1+
PHP 8.1 native enums replace class constant hacks — providing type-safe, enumerable, matchable values with optional backing values (: string or : int).
3mo ago PHP intermediate
ereg() / eregi() — POSIX Regex Removed in PHP 7 PHP 3.0+
ereg() and eregi() were POSIX regex functions removed in PHP 7.0 — replace with preg_match() (PCRE) which is faster, more powerful, and the standard since PHP 4.
3mo ago PHP beginner
Error Logging PHP 4.0+ 🧠 2
Recording application errors, exceptions, and diagnostic information to persistent storage — essential for diagnosing production issues where display_errors must be off and errors are invisible to users.
3mo ago PHP beginner
Error Reporting & Display PHP 4.0+ 🧠 1
PHP's error_reporting level and display_errors directive control which errors are shown and where — development needs E_ALL with display on; production needs E_ALL with display off and logging on.
3mo ago PHP beginner
Exception Handling Introduced (PHP 5) PHP 5.0+
PHP 5 introduced try/catch/finally and the Exception class — replacing PHP 4's procedural error handling with structured exception-based patterns.
3mo ago PHP beginner
Enum::cases() & Enum from()/tryFrom() PHP 8.1+
Backed enums provide from() (throws on miss) and tryFrom() (returns null) for value lookup, plus cases() to get all cases — essential for forms and validation.
3mo ago PHP intermediate
Enums Implementing Interfaces PHP 8.1+
PHP 8.1 enums can implement interfaces, allowing them to be used wherever an interface is expected — enabling polymorphic enum-based dispatch.
3mo ago PHP intermediate
Exception Hierarchy (Throwable, Error, Exception) PHP 7.0+ 🧠 1
PHP 7+ unified exceptions and fatal errors under the Throwable interface — catch Throwable to handle both Error and Exception in one block.
3mo ago PHP intermediate
Enum Methods, Interfaces & Constants (PHP 8.1) PHP 8.1+
PHP 8.1 enums support methods, interface implementation, constants, and static factory methods — making them full-featured types, not just value lists.
3mo ago PHP intermediate
Enums (PHP 8.1) PHP 8.1+ 🧠 3
Native enumerations providing type-safe named constants that replace class-constant patterns and stringly-typed values.
3mo ago PHP intermediate
Error Handling in PHP PHP 5.0+ 🧠 2
Uncaught errors and verbose error output expose stack traces, file paths, and credentials to attackers.
CWE-209 OWASP A9:2021
3mo ago PHP beginner 5.3
escapeshellarg() PHP 5.0+ 🧠 1
Wraps a string in single quotes and escapes internal quotes for safe use as a single shell argument.
3mo ago PHP intermediate
Exception Hierarchy & Custom Exceptions PHP 5.0+
Defining domain-specific exception classes that extend SPL exceptions provides semantic meaning and enables granular catch blocks.
3mo ago PHP intermediate
extract() — Dangerous Variable Injection PHP 4.0+ 🧠 1
extract() creates local variables from an array, allowing attackers to overwrite existing variables if input is unsanitised.
CWE-621 OWASP A3:2021
3mo ago PHP beginner 9.8
Diagram: Exception Handling (try/catch/finally) Exception Handling (try/catch/finally) PHP 5.0+ 🧠 3
PHP's structured error handling mechanism that separates error-path code from the happy path and ensures resource cleanup.
3mo ago PHP intermediate
✓ schema.org compliant