> On 15 Oct, 2014, at 9:23 am, Stas Malyshev <smalys...@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 > -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php