[wp-trac] [WordPress Trac] #56127: WP_Widget contructor throws fatal ArgumentCountError in WordPress 6.0 running on PHP 8

WordPress Trac noreply at wordpress.org
Fri Oct 14 14:33:55 UTC 2022


#56127: WP_Widget contructor throws fatal ArgumentCountError in WordPress 6.0
running on PHP 8
------------------------------------------------+--------------------------
 Reporter:  firefly2000                         |       Owner:  (none)
     Type:  defect (bug)                        |      Status:  new
 Priority:  normal                              |   Milestone:  Awaiting
                                                |  Review
Component:  Widgets                             |     Version:  6.0
 Severity:  normal                              |  Resolution:
 Keywords:  needs-patch reporter-feedback php8  |     Focuses:  coding-
                                                |  standards
------------------------------------------------+--------------------------

Comment (by trevordearham):

 I just updated to WordPress 6.0.2 successfully and then to PHP 8.0. When
 switch to PHP 8.0, I got the same error mentioned. It can be seen in the
 release code for WordPress 6.0.2
 https://github.com/WordPress/WordPress/blob/6.0.2/wp-includes/class-wp-
 widget-factory.php#L61.

 Applying the suggested patch to that line causes the code to work, but
 probably not the ideal solution.

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


More information about the wp-trac mailing list