PHP 8.3 Typed Class Constants
PHP 8.3 added type declarations for class constants. const VERSION: string = '1.0.0'; rejects an integer at compile time. The same applies to enum cases and interface constants.It …
Read article →PHP 8.3 added type declarations for class constants. const VERSION: string = '1.0.0'; rejects an integer at compile time. The same applies to enum cases and interface constants.It …
Read article →PHP 8.2 introduced readonly as a class-level modifier. Every property in a readonly class is implicitly readonly — perfect for value objects.Combined with constructor property…
Read article →PHP 8.1 enums replace the old constant-on-a-class pattern. Backed enums map to int or string values — enum Status: string { case Active = 'active';…
Read article →Fibers are stackful coroutines: Fiber::suspend() yields back to the caller, and $fiber->resume() picks up where it left off. They are the runtime primitive behind async…
Read article →The match expression is type-safe and value-returning. Unlike switch, it uses strict comparison, requires no break, and throws on an unhandled value (or falls through…
Read article →Named arguments let you skip optional parameters and document the call site. htmlspecialchars($s, double_encode: false) reads better than five positional true/false arguments.They …
Read article →PHP 8.1 introduced strtoupper(...) — a syntactically clean way to reference a function as a callable. Same for methods: $user->email(...).It replaces the older string-or-array c…
Read article →Composer 2 rewrote the solver. Typical installs are 50–80% faster and use a fraction of the memory of Composer 1. Lock files generated by Composer…
Read article →Octane runs a Laravel application inside a persistent worker — FrankenPHP, RoadRunner, or Swoole — so the framework boots once instead of every request.Typical request…
Read article →Set PDO::ATTR_ERRMODE to PDO::ERRMODE_EXCEPTION. Set PDO::ATTR_EMULATE_PREPARES to false so the database (not PHP) does the prepare. Set PDO::ATTR_DEFAULT_FETCH_MODE to PDO::FETCH_…
Read article →