// Learn
// Sandbox
// Reference
<?php
Beyond the basics
Advanced PHP features most developers never learned from books β€” generators, fibers, match expressions, named arguments, and the entire modern PHP 8.x world.
PHP
Output php://stdout
PHP Quick Reference
// advanced Β· modern Β· PHP 8.x
FeaturePHP Ver.RarityPurpose
match8.0RareStrict value matching expression (no fallthrough)
Named Arguments8.0RarePass args by parameter name, skip optional ones
Nullsafe Operator ?->8.0RareChain methods without null checks
Union Types int|string8.0RareMultiple accepted types in one declaration
Constructor Promotion8.0EpicDeclare + assign properties in constructor params
Attributes #[...]8.0EpicNative annotations / metadata on classes & methods
throw expression8.0RareThrow exceptions in expressions, not just statements
Fibers8.1LegendCooperative multitasking / async primitives
Enums8.1EpicFirst-class enumeration types
Readonly Properties8.1RareWrite-once property enforcement
Intersection Types A&B8.1EpicValue must satisfy multiple types simultaneously
First-class callables8.1Epicstrlen(...) as a closure reference
Readonly Classes8.2RareAll properties readonly by default
DNF Types8.2LegendDisjunctive Normal Form type expressions
never return type8.1EpicFunction never returns (throws or exits)
Generators yield5.5EpicLazy iterators β€” produce values one at a time
yield from7.0LegendDelegate to another generator or iterable
Spread operator ...5.6RareUnpack arrays into function arguments
Named captures in regexanyEpic(?P<name>...) in preg functions
array_is_list()8.1RareCheck if array is a sequential list
str_contains/starts/ends8.0RareReadable string search helpers
fdiv()8.0LegendIEEE 754 safe division returning INF/NAN instead of errors
WeakMap8.0LegendObject-keyed map that doesn't prevent garbage collection
Splat in const expressions8.1LegendSpread arrays in const initializers
static return type8.0EpicReturn type that refers to the called class (fluent APIs)
Closure bind / bindTo5.4EpicRebind closures to different objects/scopes
compact() / extract()anyRareConvert between variable names and arrays
array_walk_recursive()anyRareApply callback to all nested array values