RE: [PHP-DEV] Inline constructing/cloning and inline foreach listing

2011-06-07 Thread John Crenshaw
From: Hannes Landeholm [mailto:landeh...@gmail.com] Sent: Tuesday, June 07, 2011 11:50 AM To: John Crenshaw; internals@lists.php.net Subject: Re: [PHP-DEV] Inline constructing/cloning and inline foreach listing On 7 June 2011 15:53, John Crenshaw mailto:johncrens...@priacta.com>>

Re: [PHP-DEV] Inline constructing/cloning and inline foreach listing

2011-06-07 Thread Hannes Landeholm
On 7 June 2011 15:53, John Crenshaw wrote: > > foreach ($arrays as list($e1, $e2, $e3)) { ... > > Disagree. This feels very obtuse. I wouldn't expect this construct to work > at all, and even if it did, it is highly ambiguous (I.E. at first I thought > you were intending to grab 3 entries at a ti

RE: [PHP-DEV] Inline constructing/cloning and inline foreach listing

2011-06-07 Thread John Crenshaw
> // Inline constructing: > $car = (new CarFactory())->makeCar(); > // Inline cloning: > $tomorrow = (clone $today)->add($one_day); Agreed. The fact that these expressions can't be wrapped in parentheses never made any sense to me. > foreach ($arrays as list($e1, $e2, $e3)) { ... Disagree. This

Re: [PHP-DEV] Inline constructing/cloning and inline foreach listing

2011-06-07 Thread Felipe Pena
Hi, 2011/6/7 Hannes Landeholm > Hi, > > I like to do stuff "inline" instead of cluttering my code with variables. > There are currently three syntaxes/expressions which are currently not > supported but I hope could be implemented until 5.4. > > First inline constructing (which I think has alrea