[wp-trac] [WordPress Trac] #40163: PHP 7 bug in nav-menu.php

WordPress Trac noreply at wordpress.org
Wed Mar 15 14:45:59 UTC 2017


#40163: PHP 7 bug in nav-menu.php
-------------------------------+------------------------------
 Reporter:  lucaspw            |       Owner:
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  General            |     Version:
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:
-------------------------------+------------------------------
Changes (by ocean90):

 * keywords:   => reporter-feedback


Old description:

> Hi
>
> In PHP 7 is bug in nav menus and wordpress respond error:
>
> <b>Notice</b>:  Array to string conversion in
> <b>/Applications/MAMP/htdocs/enginzyme/wp-includes/nav-menu.php</b> on
> line <b>604</b><br />
>
> This can be fast fix, you must replace this line:
>
> 604. $items[$k]->$args['output_key'] = $i++;
>
> for:
>
> $items[$k]->{$args['output_key']} = $i++;

New description:

 Hi

 In PHP 7 is bug in nav menus and wordpress respond error:

 <b>Notice</b>:  Array to string conversion in
 <b>/Applications/MAMP/htdocs/enginzyme/wp-includes/nav-menu.php</b> on
 line <b>604</b><br />

 This can be fast fix, you must replace this line:


 {{{
 $items[$k]->$args['output_key'] = $i++;
 }}}


 for:


 {{{
 $items[$k]->{$args['output_key']} = $i++;
 }}}

--

Comment:

 Hello @lucaspw, welcome to WordPress Trac!

 Thanks for your report. This has already been fixed in WordPress 4.3, see
 [33427]. What version are you using?

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


More information about the wp-trac mailing list