PHP 8.0 sürümü yayınlandı
(php.net)-
İki JIT motoruyla hız iyileştirmesi: Tracing JIT + Function JIT
-
Tip sistemi ve hata işleme iyileştirildi
-
Named arguments
→ htmlspecialchars($string, double_encode: false);
- Attributes
→ #[Route("/api/posts/{id}", methods: ["GET"])]
- Constructor property promotion
→ __construct( public float $x = 0.0 ) {}
- Union Type
→ private int|float $number
- Match expression
→ match (8.0) { '8.0' => "Oh no!", 8.0 => "This is what I expected", };
- Nullsafe operator
→ $country = $session?->user?->getAddress()?->country;
- Daha tutarlı string-sayı karşılaştırmaları
→ 0 == 'foobar' // false (önceden true idi)
- Ek olarak: WeakMap sınıfı, Stringable arayüzü,
str_contains(),str_starts_with(),str_ends_with()fonksiyonları
2 yorum
Şu anda
empty("0") => true, peki 8'de gerçekten ne olacak?!8'de de aynı kalmış hehe