[wp-trac] [WordPress Trac] #16895: wp_list_pluck cannot be used with arrays of references

WordPress Trac wp-trac at lists.automattic.com
Sat Mar 19 15:39:03 UTC 2011


#16895: wp_list_pluck cannot be used with arrays of references
-----------------------------------------+-----------------------------
 Reporter:  dd32                         |       Owner:
     Type:  enhancement                  |      Status:  new
 Priority:  normal                       |   Milestone:  Future Release
Component:  General                      |     Version:  3.1
 Severity:  normal                       |  Resolution:
 Keywords:  has-patch reporter-feedback  |
-----------------------------------------+-----------------------------

Comment (by hakre):

 To demonstrate an overwrite, see this example:

 {{{
 $one = array('num' => 1);
 $input = array( &$one, &$one );

 $nums = wp_list_pluck($input, 'num');

 var_dump($nums, $input);
 }}}

 will do notices on trunk and set both keys to NULL in `$nums`.

 But I still can not see how that should apply to `$wp_query->comments` (I
 didn't get it filled in my test script either, just asking).

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


More information about the wp-trac mailing list