#38397 [NEW]: ArrayObject not acting as object

From: Date: Wed, 09 Aug 2006 09:32:57 +0000
Subject: #38397 [NEW]: ArrayObject not acting as object
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-100576@lists.php.net to get a copy of this message
From: ante at novisplet dot com Operating system: Win XP PHP version: 5.2.0RC1 PHP Bug Type: SPL related Bug description: ArrayObject not acting as object Description: ------------ If I have an array like this: ArrayObject Object ( [group] => Document_Group Object ( [_dbat] => 0 [_table] => document_group [_tableat] => document_group [_where] => [_saved] => 1 [_lasterr] => [_original] => Array ( [0] => 1 [1] => skupina 1 ) [group_id] => 1 [name] => skupina 1 ) [documents] => ArrayObject Object ( [0] => Document Object ( [_dbat] => 0 [_table] => document [_tableat] => document [_where] => [_saved] => 1 [_lasterr] => [_original] => Array ( [0] => 1 [1] => Dokument 1 [2] => [3] => 1 ) [document_id] => 1 [name] => Dokument 1 [path] => [group_id] => 1 ) [1] => Document Object ( [_dbat] => 0 [_table] => document [_tableat] => document [_where] => [_saved] => 1 [_lasterr] => [_original] => Array ( [0] => 3 [1] => Dokument 3 [2] => [3] => 1 ) [document_id] => 3 [name] => Dokument 3 [path] => [group_id] => 1 ) [2] => Document Object ( [_dbat] => 0 [_table] => document [_tableat] => document [_where] => [_saved] => 1 [_lasterr] => [_original] => Array ( [0] => 5 [1] => Dokument 5 [2] => [3] => 1 ) [document_id] => 5 [name] => Dokument 5 [path] => [group_id] => 1 ) ) ) And if I want to access group name the path would be $array->group->name but it doesn't work... I have to use "old style" $array['group']->name to get group name... Reproduce code: --------------- See description... Expected result: ---------------- Name of the group to be in $array->group->name Actual result: -------------- but it is in $array['group']->name Although everything is "ArrayObject"-ed... -- Edit bug report at http://bugs.php.net/?id=38397&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=38397&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=38397&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=38397&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=38397&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=38397&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=38397&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=38397&r=needscript Try newer version: http://bugs.php.net/fix.php?id=38397&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=38397&r=support Expected behavior: http://bugs.php.net/fix.php?id=38397&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=38397&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=38397&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=38397&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=38397&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=38397&r=dst IIS Stability: http://bugs.php.net/fix.php?id=38397&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=38397&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=38397&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=38397&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=38397&r=mysqlcfg

« previous php.bugs (#100576) next »