Что нового в PHP 8.0?
- Named arguments:
str_contains(haystack: $s, needle: 'x') - Match expression: строгое сравнение, возвращает значение
- Union types:
int|string - Nullsafe operator:
$user?->getAddress()?->getCity() - Constructor property promotion
- Attributes:
#[Route('/api')] - JIT компиляция
- str_contains, str_starts_with, str_ends_with
- WeakMap
- throw как выражение:
$value ?? throw new Exception() - Изменение сравнения 0 == "foo" (теперь false)