|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #81411 Casting object with numeric keys to array
Submitted: 2021-09-03 08:57 UTC Modified: -
From: biziclop at vipmail dot hu Assigned:
Status: Open Package: Arrays related
PHP Version: Irrelevant OS: N/A
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2021-09-03 08:57 UTC] biziclop at vipmail dot hu
From manual page:

"with a few notable exceptions: integer properties are unaccessible"  

This is fortunately untrue since PHP 7.2:  

The reverse direction (array to object casts) are already documented:

"Note that in this case before PHP 7.2.0 numeric keys have been inaccessible unless iterated."

Test script:


Add a Patch

Pull Requests

Add a Pull Request

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed May 29 02:01:30 2024 UTC