← 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
Traits — Horizontal Reuse (PHP 5.4) PHP 5.4+
PHP 5.4 traits enable horizontal code reuse — mixins for PHP classes that can't use multiple inheritance. Use sparingly; prefer composition over trait overuse.
3mo ago PHP intermediate
Typed Class Constants (PHP 8.3) PHP 8.3+
PHP 8.3 allows class, interface, and enum constants to declare an explicit type, catching type mismatches at definition time rather than at runtime when the constant is used.
3mo ago PHP intermediate
Typed Properties (PHP 7.4) PHP 7.4+
PHP 7.4 typed properties add type declarations to class properties — public string $name — preventing type mismatches and enabling full static analysis of object state.
3mo ago PHP intermediate
TypeError — When Type Declarations Throw PHP 7.0+
TypeError is thrown when a value passed to a typed parameter or return type doesn't match — strict_types=1 makes this happen at call sites too.
3mo ago PHP intermediate
Type Widening & Covariance/Contravariance PHP 7.4+ 🧠 2
PHP's rules for overriding method types in subclasses — return types are covariant (can narrow), parameter types are contravariant (can widen), enforced since PHP 7.4.
3mo ago PHP advanced
Diagram: Traits Traits PHP 5.4+ 🧠 1
Reusable code blocks that can be mixed into any class, providing horizontal code reuse without inheritance.
3mo ago PHP intermediate
Type Casting in PHP PHP 5.0+ 🧠 2
Explicitly converting a value to another type using (int), (string), (array), (object) casts or intval(), strval() functions.
3mo ago PHP beginner
Type Coercion PHP 7.0+ 🧠 3
PHP's automatic conversion between types can produce unexpected comparison results, leading to logic bugs and security bypasses.
CWE-704 OWASP A3:2021
3mo ago PHP intermediate 8.1
Type Declarations Overview PHP 7.0+ 🧠 2
PHP's full type system: scalar types, return types, union types, intersection types, nullable, never, and mixed — all enforced at runtime.
3mo ago PHP intermediate
✓ schema.org compliant