7P by xguru 2020-11-27 | favorite | 댓글 2개

- 두개의 JIT 엔진으로 속도 개선 : Tracing JIT + Function JIT
- 타입 시스템 과 에러처리 개선

- 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;
- Saner string to number comparisons
ㅤ→ 0 == 'foobar' // false (예전엔 true 였음)

- 추가 : WeakMap 클래스, Stringable 인터페이스, str_contains(), str_starts_with(), str_ends_with() 함수들

지금은 empty(“0”) => true 인데 8에서는 과연?!

8에서도 그대로네요 ㅎㅎ