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 →Notes on JavaScript, PHP, WordPress, design, performance, and the practical side of shipping better digital products.
Topics covered
The blog is designed to support both technical readers and clients who want clearer language around scope, quality, and implementation decisions.
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 →