RE: [SMARTY-DEV] foreach tag and objects

From: Date: Sun, 16 Jan 2005 21:23:39 +0000
Subject: RE: [SMARTY-DEV] foreach tag and objects
References: 1  Groups: php.smarty.dev 
Request: Send a blank email to php-smarty-dev+get-2605@lists.php.net to get a copy of this message
Boris, I looked at your patch. You're removing the type casting of the variable to an array. I believe this was done intentionally, because casting an int to an array creates an array with one value, the int. Same goes for other variable types. You cannot simply remove this. David > -----Original Message----- > From: Boris Bezrukov [mailto:lovchy@php.net] > Sent: Monday, January 10, 2005 5:59 PM > To: Boris Bezrukov > Cc: smarty-dev@lists.php.net > Subject: Re: [SMARTY-DEV] foreach tag and objects > > Boris Bezrukov wrote: > > > Hello. > > Smarty does use (array)$from syntax within compiled {foreach} tag. I > > suppose that was introduced to avoid errors with $from in scalar data > > types? Is indeed comfortable for PHP4, but PHP5 had introduced > > iterators, so objects can now be used within foreach construct either. > > How do you think if it should be removed? Yep, it can be replaced with > > something like if(!is_object), but should it? > > > > Patch removing them attached. > > > > Thank you. > > > Forgot to attach file.

« previous php.smarty.dev (#2605) next »