#49537 [Opn->Bgs]: ArrayAccess offsetSet give null argument values when using $append[]

From: Date: Sat, 12 Sep 2009 22:17:29 +0000
Subject: #49537 [Opn->Bgs]: ArrayAccess offsetSet give null argument values when using $append[]
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-142287@lists.php.net to get a copy of this message
ID: 49537 User updated by: kevinpeno at gmail dot com Reported By: kevinpeno at gmail dot com -Status: Open +Status: Bogus Bug Type: SPL related Operating System: WIN7 PHP Version: 5.3.0 New Comment: Sorry... Previous Comments: ------------------------------------------------------------------------ [2009-09-12 22:09:09] kevinpeno at gmail dot com I messed up my description. This is what it should ahve been: Whenever you use the $append[] method, offsetSet arguments in object implementing ArrayAccess will receive only NULL values. ------------------------------------------------------------------------ [2009-09-12 22:07:29] kevinpeno at gmail dot com Description: ------------ Whenever you use the $append[] method, offsetGet in object implementing ArrayAccess. Reproduce code: --------------- <?php class MyArrayObject extends ArrayObject { function offsetSet( $k, $v ) { //Will Print OffsetSet: \n NULL \n NULL - var_dump( 'offsetSet:', $k, $value ); } } $test = new MyArrayObject(); $test[] = 'test'; ?> Expected result: ---------------- Arguments in offsetGet should return the new offset key and the value properly. Actual result: -------------- $k and $v in the example above var_dump to NULL ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=49537&edit=1

« previous php.bugs (#142287) next »