Bug #66173 Object/array conversion breaks property/element accessibility.
| From: | Yasuo Ohgaki | Date: | Sat, 11 Jan 2014 01:45:50 +0000 |
| Subject: | Bug #66173 Object/array conversion breaks property/element accessibility. | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-71052@lists.php.net to get a copy of this message | ||
Hi all,
Object to array conversion breaks property accessibility as described in
https://bugs.php.net/bug.php?id=66173
<?php
$obj = new StdClass;
$obj->{1} = 123;
$ary = (array)$obj;
var_dump($obj->{1}, $ary[1], $ary);
http://3v4l.org/9eoU0
$ary has '12' element but it's a *string* key instead of int key.
Array to object conversion seems to have similar issue.
http://3v4l.org/vFuWT
Someone posted patch to bug report, anyone who has karma for Zend
could take a look at it and fix?
Regards,
--
Yasuo Ohgaki
yohgaki@ohgaki.net