Re: Possibilities to fix some really poor behaviors in PHP7
| From: | Tjerk Meesters | Date: | Wed, 15 Oct 2014 01:39:35 +0000 |
| Subject: | Re: Possibilities to fix some really poor behaviors in PHP7 | ||
| References: | 1 2 3 4 5 6 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-78086@lists.php.net to get a copy of this message | ||
> On 15 Oct, 2014, at 9:23 am, Stas Malyshev <smalyshev@sugarcrm.com> wrote:
>
> Hi!
>
>> For the array-to-object conversion, no scanning is necessary, since the
>> internal implementation already knows which keys are integers and which
>> strings. For the vast majority of cases, the array passed in will have
>
> Could you explain this? How you know which keys are integers and which
> strings without actually checking them?
He means there's no additional effort required to know whether the key of each element is a
string or not, because that work has already been done at the insert/update stage.
>
>> object. I would strongly suspect that most objects have very few
>> properties, and very few property names would pass a simple test of "is
>> first character a digit" but subsequently fail the full is numeric test.
>
> You still have to scan through all of them, even if they have no digits
> at all.
> --
> Stanislav Malyshev, Software Architect
> SugarCRM: http://www.sugarcrm.com/
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>