From:             pecoes at xs4all dot nl
Operating system: WinXP
PHP version:      5.0.3
PHP Bug Type:     SPL related
Bug description:  ArrayObject: object- and array-access not interchangeable

Description:
------------
It's pretty counter-intuitive, that you can neither access an
ArrayObject's properties with the array-syntax, nor its array-values with
the object-syntax. I think these two should be interchangeable. Preferably
like in ECMAScript...

Reproduce code:
---------------
$a = new ArrayObject();

$a->one   = 1;
$a['two'] = 2;

echo "\$a->one: $a->one \$a->two: $a->two \n";
echo "\$a[one]: $a[one] \$a[two]: $a[two] \n";

Expected result:
----------------
$a->one: 1 $a->two: 2 
$a[one]: 1 $a[two]: 2 

Actual result:
--------------
$a->one: 1 $a->two:
$a[one]:  $a[two]: 2 

-- 
Edit bug report at http://bugs.php.net/?id=33015&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=33015&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=33015&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=33015&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=33015&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=33015&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=33015&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=33015&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=33015&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=33015&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=33015&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=33015&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=33015&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=33015&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=33015&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=33015&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=33015&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=33015&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=33015&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=33015&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=33015&r=mysqlcfg

Reply via email to