|Stats: 289 members, 6,395 topics. Date: April 28, 2017, 12:51 pm|
The Null Coalescing Operator makes life easier for php programmers. Thanks to the php core team members and every other contributors.
Null Coalescing Operator helps you check for null value.
Previous version of php here is how it is done:
$firstname = isset($user->firstname) ? $user->firstname : 'guest';But now cleaner and easy with PHP7:
$firstname = $user->firstname ?? 'guest';
Enjoy coding, and stay safe.
Viewing this topic: 1 guest viewing this topic
TnLounge - Copyright © 2017 TnLounge. All rights reserved.
Contact us / How to post on TN
Follow TnLounge on Facebook and Twitter
Disclaimer: Every TnLounge member is solely responsible for anything that he/she posts or uploads on TnLounge.