Loading...
PHP Null Coalescing Operator(??)와 Spaceship Operator()로 코드 가독성 100배 높이기

PHP 개발자들이 자주 쓰는 삼항 연산자(ternary operator)는 사실 꽤 장황하고 읽기 어렵다. 특히 변수가 null인지 확인하고 기본값을 할당할 때마다 isset() ? $var : $default 같은 코드를 반복하면서 코드가 금방 복잡해진다. 다만 PHP 7.0 이상에서 제공하는 Null Coalescing Operator(??)와 Spac···

0 0
REDINFO Since 2014
webmaster@redinfo.co.kr
Copyright © Redinfo All Rights Reserved