Bug #66173 [Ana]: Object/Array cast loses numeric property/element accessibility

[email protected]
Newsgroups php.bugs
Message-ID <[email protected]>
Edit report at https://bugs.php.net/bug.php?id=66173&edit=1

 ID:                 66173
 Updated by:         [email protected]
 Reported by:        to dot yashin at gmail dot com
-Summary:            Object/Array cast looses numeric property/element
                     accessibility
+Summary:            Object/Array cast loses numeric property/element
                     accessibility
 Status:             Analyzed
 Type:               Bug
 Package:            Arrays related
 Operating System:   *
 PHP Version:        5.0 to master
 Assigned To:        ajf
 Block user comment: N
 Private report:     N

 New Comment:

Corrected spelling error


Previous Comments:
------------------------------------------------------------------------
[2015-12-23 23:18:27] [email protected]

Related To: Bug #70733

------------------------------------------------------------------------
[2015-12-19 04:08:56] [email protected]

Related To: Bug #70692

------------------------------------------------------------------------
[2014-01-11 01:44:53] [email protected]

Array to object conversion seems to have similar issue.

http://3v4l.org/vFuWT

------------------------------------------------------------------------
[2014-01-11 01:27:50] [email protected]

Variable/property that has numeric name can be accessed, but object to array conversion breaks accessibility. 

http://3v4l.org/DY9bZ

It's better to be fixed. IMO.

------------------------------------------------------------------------
[2014-01-08 02:31:36] phpmpan at mpan dot pl

Maybe it should be prohibited to pass illegal names to ->{} operator? Pros:
 - Such names can't be accessed with -> operator anyway, so they have marginal use cases.
 - This bug.
 - Potentially bugs can arise in user code that assumes objects can't contain invalid names.

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=66173


--
Edit this bug report at https://bugs.php.net/bug.php?id=66173&edit=1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.