[wp-trac] [WordPress Trac] #49728: [PHP 8] Prepare for the internal functions throwing `TypeError` or `ValueError` exceptions on unexpected types/values

WordPress Trac noreply at wordpress.org
Tue Jan 25 17:27:15 UTC 2022


#49728: [PHP 8] Prepare for the internal functions throwing `TypeError` or
`ValueError` exceptions on unexpected types/values
-------------------------------------------------+-------------------------
 Reporter:  ayeshrajans                          |       Owner:
                                                 |  hellofromTonya
     Type:  defect (bug)                         |      Status:  assigned
 Priority:  normal                               |   Milestone:  6.0
Component:  Build/Test Tools                     |     Version:
 Severity:  minor                                |  Resolution:
 Keywords:  needs-patch needs-unit-tests needs-  |     Focuses:
  dev-note needs-codex php8                      |
-------------------------------------------------+-------------------------

Comment (by JavierCasares):

 I just update from WordPress 5.8.3 to WordPress 5.9-RC4 (with PHP 8.0) and
 get this error:

 {{{
 2022/01/25 17:17:30 [error] 392481#392481: *6305 FastCGI sent in stderr:
 "PHP message: PHP Fatal error:  Uncaught TypeError:
 call_user_func_array(): Argument #1 ($callback) must be a valid callback,
 function "wp_admin_bar_edit_site_menu" not found or invalid function name
 in /path/wp-includes/class-wp-hook.php:303
 Stack trace:
 #0 /path/wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters()
 #1 /path/wp-includes/plugin.php(518): WP_Hook->do_action()
 #2 /path/wp-includes/admin-bar.php(95): do_action_ref_array()
 #3 /path/wp-includes/class-wp-hook.php(303): wp_admin_bar_render()
 #4 /path/wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters()
 #5 /path/wp-includes/plugin.php(470): WP_Hook->do_action()
 #6 /path/wp-admin/admin-header.php(267): do_action()
 #7 /path/wp-admin/admin.php(239): require_once('...')
 #8 /path/wp-admin/tools.php(40): require_once('...')
 #9 {main}
   thrown in /path/wp-includes/class-wp-hook.php on line" while reading
 upstream, client: 185.140.212.136, server: www.example.com, request: "GET
 /wp-admin/tools.php?page=health-check HTTP/2.0", upstream:
 "fastcgi://unix:/var/run/php/example80.sock:", host: "www.example.com",
 referrer: "https://www.example.com/wp-admin/tools.php"
 }}}

 Just changed it to PHP 7.4 and works fine, but many people using PHP 8.0
 may get this error just in WP-Admin.

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


More information about the wp-trac mailing list