Le Sun, 10 May 2020 10:49:15 -0500,
Ralph Schindler <ra...@ralphschindler.com> a écrit :
> The chosen syntax is:
> 
>    return if ( if_expr ) [: optional_return_expression] ;
> 
> As a contrived example:
> 
>      function divide($dividend, $divisor = null) {
>          return if ($divisor === null || $divisor === 0);
> 
>          return $dividend / $divisor;
>      }

I do not understand the point, you are just reordering keywords, why is
that better than already correct code:

      function divide($dividend, $divisor = null) {
          if ($divisor === null || $divisor === 0) return;
 
          return $dividend / $divisor;
      }

I do not think an RFC and a special keyword are justified just to move
the word "return" from end to beginning of line.

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

Reply via email to