Re: [PHP4BETA] Walking through vars on objects.

From: Date: Mon, 13 Dec 1999 15:21:03 +0000
Subject: Re: [PHP4BETA] Walking through vars on objects.
References: 1  Groups: php.version4 
Request: Send a blank email to php-version4+get-7858@lists.php.net to get a copy of this message
Soren Staun-Pedersen wrote: > > Hey > > Once upon a time (a month back or so) you could each() and list() > object variables to get them printed.. this seems to have stopped working? > Is this a bug or a feature? :-) > > (use the newest php4 from cvs) try this: <? class a { var $v1 = 'v1'; function foo(){echo 'hallo!';} }; $ia =new a(); foreach ((array)$ia as $k=>$v){ echo "$k:$v\n";} ?> -- CIMPOESU Teodor, Web Programmer @ DIGICOM S.A. Bucharest, Romania @ Internet, site development @ teo@digiro.net , +(401)-330.47.28 official home page ~ http://www.digiro.net/ Internet web page ~ http://internet.digiro.net/

« previous php.version4 (#7858) next »