|Stats: 286 members, 6,382 topics. Date: March 22, 2017, 11:20 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 © 2016 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.