PHP 8.3 — Features and Syntax Quick Reference
PHP 8.3 — Features and Syntax Quick Reference New in PHP 8.3 PHP 8.x Features in Use php // Named arguments (8.0) arrayslice(array: $arr, offset: 2, length: 5); // Match expression (8.0) $result = match($status) { 'active' => 'Online', 'banned' => 'Blocked', default => 'Unknown', }; // Nullsafe operator (8.0) $city = $user?->getAddress()?->getCity(); // Fibers (8.1) $fiber = new Fiber(fn() => 'done'); // Enums (8.1) enum Status: string { case Active = 'active'; case Banned = 'banned'; } // Readonly properties (8.1) class User { public function construct( public readonly int $id, public readonly string $email, ) {} } // First class callables (8.1) $fn = strlen(...); // Intersection types (8.1) function foo(Countable&Iterator $x) {} // readonly classes (8.2) readonly class Point { public function construct( public float $x, public float $y, ) {} } Common Patterns php // Strict types (always use) declare(stricttypes=1); // Type-safe DB value $id = (int) DB::value("SELECT id FROM ..."); // Null coalescing $name = $POST['name'] ?? 'default'; // Spread operator $merged = [...$arr1, ...$arr2]; // Array destructuring [$first, $second] = $array; [, $second] = $array; // skip first // Short closure $double = fn($x) => $x 2;
Related Guides
- Vectric Aspire — Toolpath Settings Quick Reference
- LightBurn — Keyboard Shortcuts and Workflow Tips
- Orca Slicer — Global Settings Reference
- MariaDB — Common Queries and Admin Reference
- UGS (Universal Gcode Sender) — Settings and Macro Reference
- Home Workshop Safety Reference — PPE, Fire, Fumes
- Wolfpawn 4040 Pro — Feeds and Speeds Quick Card
- Longer Ray5 20W — LightBurn Quick Settings Card