[wp-trac] [WordPress Trac] #18975: [E_STRICT] menu.php at line 218

WordPress Trac wp-trac at lists.automattic.com
Fri Oct 28 17:28:29 UTC 2011


#18975: [E_STRICT] menu.php at line 218
--------------------------------------+-----------------------
 Reporter:  arena                     |       Owner:
     Type:  defect (bug)              |      Status:  reopened
 Priority:  normal                    |   Milestone:  3.3
Component:  Menus                     |     Version:  3.3
 Severity:  normal                    |  Resolution:
 Keywords:  dev-feedback needs-patch  |
--------------------------------------+-----------------------

Comment (by scribu):

 > reset() and end() don't work as you might expect, depending on the order
 items were added to the array.

 Yes, in the sense that order matters, even for associative arrays:

 {{{array( 'a' => 1, 'b' => 2 )}}} vs. {{{array( 'b' => 2, 'a' => 1 )}}}

 but array_shift() and array_pop() follow the same rule.

 > end(), key(), and reset() all require references like array_shift() and
 array_pop(), so they don't eliminate the requirement for the variable.

 They don't eliminate the requirement for the variable, but they avoid all
 the work that array_shift() and array_pop() do, which can be significant,
 especially in the case of wp-db.php.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/18975#comment:19>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list