[wp-trac] [WordPress Trac] #64728: Using null as an array offset is deprecated in PHP 8.5.3

WordPress Trac noreply at wordpress.org
Thu Feb 26 08:06:28 UTC 2026


#64728: Using null as an array offset is deprecated in PHP 8.5.3
-----------------------------------------+---------------------
 Reporter:  sky_76                       |       Owner:  (none)
     Type:  defect (bug)                 |      Status:  new
 Priority:  normal                       |   Milestone:  7.0
Component:  Toolbar                      |     Version:  6.9.1
 Severity:  minor                        |  Resolution:
 Keywords:  has-patch reporter-feedback  |     Focuses:
-----------------------------------------+---------------------
Changes (by ozgursar):

 * keywords:  has-patch reporter-feedback needs-testing => has-patch
     reporter-feedback


Comment:

 == Patch Testing Report

 Patch Tested: https://github.com/WordPress/wordpress-develop/pull/11055

 === Environment
 - WordPress: 7.0-beta1-20260225.235833
 - PHP: 8.5.2
 - Server: PHP.wasm
 - Database: WP_SQLite_Driver (Server: 8.0.38 / Client: 3.51.0)
 - Browser: Chrome 145.0.0.0
 - OS: macOS
 - Theme: Twenty Twenty-Five 1.4
 - MU Plugins: None activated
 - Plugins:
   * Code Snippets 3.9.5
   * Test Reports 1.2.1

 === Steps taken
 1. Initiate WordPress Playground with the following link:
 https://playground.wordpress.net/?php=8.5&wp=trunk
 2. Add the following code via `functions.php` or `Code Snippets` plugin to
 trigger the PHP notice

 {{{
 add_action( 'admin_bar_menu', function( $wp_admin_bar ) {
     $wp_admin_bar->add_node( [
         'id'     => 'my-test-node',
         'title'  => 'Test Node',
         'parent' => null,
     ] );
 }, 999 );
 }}}

 3. Ensure `WP_DEBUG` and `WP_DEBUG_LOG` are true
 4. Check `/wp-content/debug.log` to view the notice:
 `PHP Deprecated:  Using null as an array offset is deprecated, use an
 empty string instead in /wordpress/wp-includes/class-wp-admin-bar.php on
 line 172`
 5. Apply patch
 https://playground.wordpress.net/?php=8.5&wp=trunk&core-pr=11055
 6. Repeat steps 2-4
 7. Confirm that `PHP Deprecated` notice does not occur
 8. ✅ Patch is solving the problem

 === Expected result
 - No further PHP Deprecated notices logged when parent is `null`

 === Screenshots/Screencast with results
 Before patch
 [[Image(https://i.imgur.com/J8JHsNH.png)]]

 After patch
 [[Image(https://i.imgur.com/aEy4rjE.png)]]

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


More information about the wp-trac mailing list