#38069 [Opn->Bgs]: Unexpected behavior as a result of __get and __set

From: Date: Wed, 12 Jul 2006 10:43:05 +0000
Subject: #38069 [Opn->Bgs]: Unexpected behavior as a result of __get and __set
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-99359@lists.php.net to get a copy of this message
ID: 38069 Updated by: tony2001@php.net Reported By: cslush at gmail dot com -Status: Open +Status: Bogus Bug Type: Class/Object related Operating System: Linux Kernel 2.6.15 PHP Version: 5.1.4 New Comment: This is what latest CVS says on your code: Fatal error: Cannot use array returned from C::__get('array') in write context and this is expected. Previous Comments: ------------------------------------------------------------------------ [2006-07-11 17:20:30] cslush at gmail dot com Description: ------------ I am getting unexpected behavior from the __get and __set methods. I am assigning an array via __set and then, by accessing it with __get, I am unable to correctly pull the last key of the array. end($this->array); $last_key = key($this->array); Reproduce code: --------------- http://rafb.net/paste/results/z7GNVF49.html Expected result: ---------------- 123456789Last Actual result: -------------- Last123456789 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=38069&edit=1

« previous php.bugs (#99359) next »