Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:24675 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 37729 invoked by uid 1010); 19 Jul 2006 13:24:43 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 37714 invoked from network); 19 Jul 2006 13:24:43 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Jul 2006 13:24:43 -0000 Authentication-Results: pb1.pair.com header.from=rquadling@googlemail.com; domainkeys=good DomainKey-Status: good X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: rquadling@googlemail.com X-Host-Fingerprint: 64.233.166.177 py-out-1112.google.com Linux 2.4/2.6 Received: from ([64.233.166.177:53688] helo=py-out-1112.google.com) by pb1.pair.com (ecelerity 2.1.1.3 r(11751M)) with ESMTP id D5/44-11992-8923EB44 for ; Wed, 19 Jul 2006 09:24:41 -0400 Received: by py-out-1112.google.com with SMTP id s49so287815pyc for ; Wed, 19 Jul 2006 06:24:38 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=googlemail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=cxw/M4EXo772xn7OItrDyJejVgsHn6MospWwV3n5OT/ouzycL3g6NzCKVED1sK6QdItj3ns/y34e3Iv0PHjfCSyKdmDOVwP1Jnr2aSMq8+iStR2GYdlH7mHXVBtQBkE0mWNYdzes1U5dDZa4QTTaXSJmbUOQustZ38Kooa3FCkk= Received: by 10.35.135.12 with SMTP id m12mr1077699pyn; Wed, 19 Jul 2006 06:24:38 -0700 (PDT) Received: by 10.35.93.20 with HTTP; Wed, 19 Jul 2006 06:24:38 -0700 (PDT) Message-ID: <10845a340607190624w44b6d7b1ycff7610d03cc3676@mail.gmail.com> Date: Wed, 19 Jul 2006 14:24:38 +0100 Reply-To: RQuadling@GoogleMail.com To: "Christian Stocker" Cc: PHPdev In-Reply-To: <44BE2AE5.4090700@bitflux.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <44BE2AE5.4090700@bitflux.ch> Subject: Re: [PHP-DEV] PHP 5.2-dev "Cannot use array returned from foo::__get('bar') in write context" From: rquadling@googlemail.com ("Richard Quadling") For PHP 5.2.0-dev (cli) (built: Jul 12 2006 12:20:25), I get ... Fatal error: Cannot use array returned from foo::__get('bar') in write context in C:\- on line 16 But only once, not 1 per line. $f = new foo(); $a = $f->bar; foreach($a as $key => $value) fixes the code. On 19/07/06, Christian Stocker wrote: > Just updated to the latest PHP 5.2-dev from CVS and now I get an Fatal > error with the following code > *** > > class foo { > public function __get($member) { > return array("foo"=>"bar","bar"=>"foo"); > } > } > > $f = new foo(); > > //error > foreach($f->bar as $key => $value) { > print "$key => $value"; > } > > ?> > *** > > It throws a > > "Fatal error: Cannot use array returned from foo::__get('bar') in write > context" > > on the foreach line. Quite annoying :) > > > That worked fine with 5.1 and also with 5.2-dev from a few days/weeks > ago (don't know, when I cvs-uped last time, but can't be that long) > > Is that expected/wished behaviour? > > chregu > > > > > -- > christian stocker | Bitflux GmbH | schoeneggstrasse 5 | ch-8004 zurich > phone +41 44 240 56 70 | mobile +41 76 561 88 60 | fax +41 1 240 56 71 > http://www.bitflux.ch | christian.stocker@bitflux.ch | GPG 0x5CE1DECB > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > -- ----- Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731