[wp-trac] [WordPress Trac] #60786: [PHP 8.4] Fix implicit nullable parameter type depcation

WordPress Trac noreply at wordpress.org
Wed May 1 17:05:09 UTC 2024


#60786: [PHP 8.4] Fix implicit nullable parameter type depcation
-----------------------------+--------------------------------
 Reporter:  ayeshrajans      |       Owner:  SergeyBiryukov
     Type:  defect (bug)     |      Status:  closed
 Priority:  normal           |   Milestone:  6.6
Component:  General          |     Version:
 Severity:  normal           |  Resolution:  fixed
 Keywords:  php84 has-patch  |     Focuses:  php-compatibility
-----------------------------+--------------------------------

Comment (by GaryJ):

 @SergeyBiryukov The RFC gives an example code change, that drops the `=
 null` when the nullable type is present. Since the default value is `null`
 when another value is not assigned to a function parameter, could we
 update the entries you changed from (for example):


 {{{
 - function test( ?string $test = null ) {}
 + function test( ?string $test ) {}
 }}}

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


More information about the wp-trac mailing list