Lesson content
Read, practise, then check your understanding
OPcache stores compiled opcodes across requests and usually matters more to web workloads than JIT. JIT compiles eligible code to machine code but does not accelerate network/database waiting.
Practical example
<?php
#[Attribute(Attribute::TARGET_METHOD)]
final class Route { public function __construct(public string $path) {} }
enum Status: string { case Draft = 'draft'; case Published = 'published'; }
Attributes provide native metadata; enums model closed case sets; match and readonly features strengthen domain code. Benchmark JIT on representative CPU-heavy workloads. Declare a minimum PHP version, monitor deprecations, and upgrade dependencies before runtime transitions.
Knowledge check
Answer every question correctly to complete this chapter.
0 of 10 checks passed
Your progress is saved on this device.