# PHP 8 의 새 기능들

> Clean Markdown view of GeekNews topic #1438. Use the original source for factual precision when an external source URL is present.

## Metadata

- GeekNews HTML: [https://news.hada.io/topic?id=1438](https://news.hada.io/topic?id=1438)
- GeekNews Markdown: [https://news.hada.io/topic/1438.md](https://news.hada.io/topic/1438.md)
- Type: news
- Author: [xguru](https://news.hada.io/@xguru)
- Published: 2020-02-04T09:56:34+09:00
- Updated: 2020-02-04T09:56:34+09:00
- Original source: [stitcher.io](https://stitcher.io/blog/new-in-php-8)
- Points: 3
- Comments: 2

## Topic Body

올해말 발표될 PHP 8에 추가될 것들

- Union 타입 : int|float 형태, |null 은 ?

- JIT

- Static 리턴 타입

- 객체들의 레퍼런스를 저장하는 WeakMap

- 객체에 get_class() 대신 ::class

- DateTime::createFromInterface()

- fdiv 함수

- 내장함수에 대한 type annotation

호환성 깨지는 변경들

- 내장 함수들도 TypeErrors 예외 던짐

- 경고만 내보냈던 많은 에러들이 적절한 예외를 던지게 변경

- 기본 에러 보고 레벨이 E_ALL 로 되면서 조용히 무시되던 많은 에러들이 보이게 될것

- @연산자가 치명적인 에러들을 무시하지 않게 됨

- '+', '-' 과 '.' 연결 연산자의 순서 조정. +/- 가 '.' 전에 처리됨

## Comments



### Comment 1062

- Author: kunggom
- Created: 2020-02-04T14:44:12+09:00
- Points: 1

역시 메이저 버전업은 호환성 깨지는 맛이죠! (…)

### Comment 1058

- Author: xguru
- Created: 2020-02-04T09:57:47+09:00
- Points: 1

새로운 기능들보다 아래쪽 에러 및 예외 처리 부분이 바뀌는게 크네요.

멋모르고 그냥 업그레이드 했다가는 그냥 조용히 에러 무시하고 넘어갔던 PHP 사이트들이 문제 생길듯
