RE: [PHP-DEV] Possibilities to fix some really poor behaviors in PHP7

2014-10-15 Thread Christian Stoller
From: julienpa...@gmail.com [mailto:julienpa...@gmail.com] On Behalf Of Julien Pauli, Sent: Tuesday, October 14, 2014 10:05 AM On Tue, Oct 14, 2014 at 9:25 AM, Stas Malyshev smalys...@sugarcrm.com wrote: Hi! ... like the hidden array element: http://3v4l.org/6uFqf ... like the hidden

Re: [PHP-DEV] Possibilities to fix some really poor behaviors in PHP7

2014-10-14 Thread Kingsquare.nl - Robin Speekenbrink
Hi, ... like the hidden array element: http://3v4l.org/6uFqf ... like the hidden object property: http://3v4l.org/RPJXH Don't know if it's related or not, but sure feels like a bug i posted a while ago: https://bugs.php.net/bug.php?id=67640 thanks! Robin -- PHP Internals - PHP Runtime

Re: [PHP-DEV] Possibilities to fix some really poor behaviors in PHP7

2014-10-14 Thread Stas Malyshev
Hi! ... like the hidden array element: http://3v4l.org/6uFqf ... like the hidden object property: http://3v4l.org/RPJXH The issue seems to be that array lookup always looks for numeric results when looking for numeric-like keys. But when adding property, the numeric check is not done since

Re: [PHP-DEV] Possibilities to fix some really poor behaviors in PHP7

2014-10-14 Thread Julien Pauli
On Tue, Oct 14, 2014 at 9:25 AM, Stas Malyshev smalys...@sugarcrm.com wrote: Hi! ... like the hidden array element: http://3v4l.org/6uFqf ... like the hidden object property: http://3v4l.org/RPJXH The issue seems to be that array lookup always looks for numeric results when looking for

Re: [PHP-DEV] Possibilities to fix some really poor behaviors in PHP7

2014-10-14 Thread Marc Bennewitz
On 14.10.2014 09:25, Stas Malyshev wrote: Hi! ... like the hidden array element: http://3v4l.org/6uFqf ... like the hidden object property: http://3v4l.org/RPJXH The issue seems to be that array lookup always looks for numeric results when looking for numeric-like keys. But when adding

Re: [PHP-DEV] Possibilities to fix some really poor behaviors in PHP7

2014-10-14 Thread Stas Malyshev
Hi! Please correct me if I'm wrong but object properties should be strings in all cases. In all cases where they are assigned as object properties. If they were produced by other means, it can be different. So all properties set should be converted to string means the following should be

Re: [PHP-DEV] Possibilities to fix some really poor behaviors in PHP7

2014-10-14 Thread Rowan Collins
On 14/10/2014 21:58, Stas Malyshev wrote: |$obj = (object)array('123' = '456'); var_dump($obj); Here the array had numeric index, so the object property became numeric index too. The alternative for this would be for this operation to scan through whole array and convert each key from numeric

Re: [PHP-DEV] Possibilities to fix some really poor behaviors in PHP7

2014-10-14 Thread Stas Malyshev
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

Re: [PHP-DEV] Possibilities to fix some really poor behaviors in PHP7

2014-10-14 Thread Tjerk Meesters
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