← 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
Iterating Objects with foreach (Iterator & IteratorAggregate) PHP 5.5+ 🧠 3
foreach can traverse any object implementing Iterator or IteratorAggregate, not just arrays — control iteration without exposing internal state.
1w ago PHP intermediate
Intersection & DNF Types in Practice PHP 8.1+
PHP 8.1 intersection types (A&B) and PHP 8.2 DNF types ((A&B)|null) allow precise type constraints for objects implementing multiple interfaces.
3mo ago PHP advanced
Integer Overflow & PHP_INT_MAX PHP 4.0+
PHP integers silently overflow to float when exceeding PHP_INT_MAX (9.2×10¹⁸ on 64-bit) — use BCMath or GMP for arbitrary precision arithmetic.
3mo ago PHP intermediate
include vs require vs *_once PHP 5.0+
require halts on failure; include warns and continues. The _once variants prevent double-loading — use require_once for dependencies.
3mo ago PHP beginner
Diagram: Interface vs Abstract Class Interface vs Abstract Class PHP 5.0+
Interfaces define pure capability contracts with no state; abstract classes add shared implementation. Use interfaces for type contracts, abstract for shared behaviour.
3mo ago PHP intermediate
Interfaces PHP 5.0+ 🧠 3
Contracts that define a set of method signatures a class must implement, enabling polymorphism without inheritance.
3mo ago PHP intermediate
Intersection Types (PHP 8.1) PHP 8.1+ 🧠 1
Require a value to satisfy multiple type constraints simultaneously, declared as TypeA&TypeB — useful for combining interfaces.
3mo ago PHP intermediate
intval() / Type Casting PHP 5.0+ 🧠 1
Casting user input to int or float is a safe way to enforce numeric types — cheaper than regex validation for IDs.
3mo ago PHP beginner
Iterators & IteratorAggregate PHP 5.0+ 🧠 1
PHP interfaces that allow custom objects to be used in foreach loops, enabling lazy and memory-efficient iteration over any data source.
3mo ago PHP intermediate
✓ schema.org compliant