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:weir...@gmail.com

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to