[Tickets #5604] Re: ListMessages endless loop
bugs at bugs.horde.org
bugs at bugs.horde.org
Mon Aug 6 07:47:29 UTC 2007
DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.
Ticket URL: http://bugs.horde.org/ticket/?id=5604
-----------------------------------------------------------------------
Ticket | 5604
Updated By | vokac at kmlinux.fjfi.cvut.cz
Summary | ListMessages endless loop
Queue | DIMP
Version | 1.0-ALPHA
Type | Bug
State | Feedback
Priority | 3. High
Owners |
-----------------------------------------------------------------------
vokac at kmlinux.fjfi.cvut.cz (2007-08-06 00:47) wrote:
<?php
$a = array('1' => 1, '2' => 2);
$b = (object)$a;
$c = get_object_vars($b);
echo "get_object_vars:\n";
foreach($c as $name=>$value) {
echo " $name: $value\n";
}
echo "iterator(?):\n";
foreach($b as $name=>$value) {
echo " $name: $value\n";
}
?>
Output on CentOS5 (PHP 5.1.6):
get_object_vars:
iterator(?):
Output on Fedora7 (PHP 5.2.2):
get_object_vars:
iterator(?):
1: 1
2: 2
It means that you can't use get_object_vars to access array content in
lib/Horde/Serialize/JSON.php:161 (on both systems) and with iterator you
can access array content only with PHP 5.2.2. If you typecast object back
to array, you can access array content also with PHP 5.1.6 (CentOS5).
More information about the bugs
mailing list