[wp-trac] Re: [WordPress Trac] #9661: cat_row doesn't not list all
categories
WordPress Trac
wp-trac at lists.automattic.com
Tue Apr 28 02:25:16 GMT 2009
#9661: cat_row doesn't not list all categories
-------------------------------+--------------------------------------------
Reporter: hailin | Owner: anonymous
Type: defect (bug) | Status: closed
Priority: normal | Milestone: Unassigned
Component: General | Version:
Severity: normal | Resolution: invalid
Keywords: reporter-feedback |
-------------------------------+--------------------------------------------
Comment(by hakre):
Replying to [comment:4 hailin]:
> From that PHP page:
>
> Note: Unless the array is referenced, foreach operates on a copy of the
specified array and not the array itself. foreach has some side effects on
the array pointer. Don't rely on the array pointer during or after the
foreach without resetting it.
>
> I guess "some side effects" is the key issue.
the refernces side effects are related to the array pointer only. the code
is not using any array pointer. additionally the foreach loop iterates
over a copy which means this is a new array, not $categories any longer
(you just quoted that as well).
Please stop guessing, you are mixing things. Using $array[$index] is not
using the arrays pointer. Learn more about array pointers in php here:
http://php.net/manual/en/function.current.php I hope that helps you to
better understand what an internal array pointer is.
So please make a proof.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/9661#comment:9>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list