Re: [RFC] anti-coalescing-operator

From: Date: Thu, 24 Oct 2019 21:23:59 +0000
Subject: Re: [RFC] anti-coalescing-operator
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-107671@lists.php.net to get a copy of this message
Hi Ken > $_SERVER['fname'] !?? $user->setName($_SERVER['fname']); > $_SERVER['lname'] !?? $user->setName($_SERVER['lname']); > $_SERVER['mname'] !?? $user->setName($_SERVER['mname']); > $_SERVER['phone'] !?? $user->setName($_SERVER['phone']); > $_SERVER['email'] !?? $user->setName($_SERVER['email']); What you described is already achievable with short-circuit && : isset($_SERVER['fname']) && $user->setName($_SERVER['fname']); Besides, it's a widely used idiom known from shell scripting. -- Best regards, Bruce Weirdan mailto:weirdan@gmail.com

« previous php.internals (#107671) next »