Re: get_class_vars() returned information ORDER
| From: | Johannes Schlüter | Date: | Sun, 09 Sep 2012 11:52:21 +0000 |
| Subject: | Re: get_class_vars() returned information ORDER | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-62916@lists.php.net to get a copy of this message | ||
On Sep 9, 2012, at 10:22, Sherif Ramadan <theanomaly.is@gmail.com> wrote:
>> I'm curious whether the ORDER of the class properties returned by
>> get_class_vars(), is in some way guaranteed. I do not find mention of it
>> in the documentation.
>>
>
> The only real guarantee is that of how the class properties are stored
> in the hashtable. get_class_vars() is essentially just reading from a
> hashtable of class properties.
There's no such guarantee. The fact that it is using a Hashtable which has an order is an
implementation detail. This might change (even though a change is unlikely) The only promise of
get_class_vars() is to return all.
johannes