[wp-trac] [WordPress Trac] #58874: Code Modernization: Consider using the null coalescing operator.

WordPress Trac noreply at wordpress.org
Fri May 31 03:58:15 UTC 2024


#58874: Code Modernization: Consider using the null coalescing operator.
-------------------------------------------------+-------------------------
 Reporter:  costdev                              |       Owner:  costdev
     Type:  enhancement                          |      Status:  accepted
 Priority:  normal                               |   Milestone:  Future
                                                 |  Release
Component:  General                              |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch awaiting-php7-make-post-   |     Focuses:
  first 2nd-opinion                              |
-------------------------------------------------+-------------------------

Comment (by noisysocks):

 > @marybaum A Make post regarding PHP 7 is being prepared which will
 include issues such as the one raised in this ticket. See comment:4.

 Has this happened?

 I don't see a downside in allowing `??` in new code right now. It's
 frustrating rewriting code that uses `??` to use `?:` when syncing changes
 from Gutenberg. It's also potentially error prone since we're rewriting
 perfectly good code that has received lots of testing into something that
 has slightly different semantics as @dmsnell notes above.

 Waiting for existing code to be updated and/or an official Make/Core post
 on the subject just sounds like we're letting process and bureaucracy get
 in the way of good outcomes for WordPress and its users.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/58874#comment:21>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list