Re: [PHP-DEV] Re: Only variables can be passed by reference

2014-12-06 Thread Andrea Faulds
Hi! > On 6 Dec 2014, at 22:25, Yasuo Ohgaki wrote: > > Value is vague term. I would like to use "expression". Expression is > anything that has value. > Variables/constants are values that have actual storage. > Literals are values that may not have actual storage. The C world already has termi

Re: Fwd: Re: [PHP-DEV] Re: Only variables can be passed by reference

2014-12-06 Thread Yasuo Ohgaki
Hi Rowan, On Sat, Dec 6, 2014 at 11:38 PM, Rowan Collins wrote: > function foo(&$bar=null) { ... } Default value for pass-by-ref parameter is matter to discuss. It's nicer if it is allowed. It would be done by creating temporary variable, I suppose. Regards, -- Yasuo Ohgaki yohg...@ohgaki.ne

Re: [PHP-DEV] Re: Only variables can be passed by reference

2014-12-06 Thread Yasuo Ohgaki
Hi Rowan, On Sat, Dec 6, 2014 at 11:25 PM, Rowan Collins wrote: > On 06/12/2014 03:03, Yasuo Ohgaki wrote: > >> Hi Rowan, >> >> On Fri, Dec 5, 2014 at 6:12 PM, Rowan Collins > > wrote: >> >> The author of function f1() presumably designed it to apply some >>

Re: Fwd: Re: [PHP-DEV] Re: Only variables can be passed by reference

2014-12-06 Thread Rowan Collins
On 04/12/2014 23:46, Chris Wright wrote: Forgot to cc list, see below -- Forwarded message -- From: "Chris Wright" Date: 4 Dec 2014 14:09 Subject: Re: [PHP-DEV] Re: Only variables can be passed by reference To: "Andrea Faulds" Cc: On 4 December 2014 at 12:26, Andrea Faulds w

Re: [PHP-DEV] Re: Only variables can be passed by reference

2014-12-06 Thread Rowan Collins
On 06/12/2014 11:00, Christoph Becker wrote: Yasuo Ohgaki wrote: In languages, there are literal, constant and variable. Return value is variable. It's better to keep basic rule. IMHO. $top = array_pop(f2()); is better than $v = f2(); $top = array_pop($v); Is there anyone who likes latter?

Re: [PHP-DEV] Re: Only variables can be passed by reference

2014-12-06 Thread Rowan Collins
On 06/12/2014 03:03, Yasuo Ohgaki wrote: Hi Rowan, On Fri, Dec 5, 2014 at 6:12 PM, Rowan Collins > wrote: The author of function f1() presumably designed it to apply some change to $v, rather than executing only for its side effects and return value.

Fwd: Re: Re: [PHP-DEV] Compari­son ­chain

2014-12-06 Thread Дмитрий
- Пересылаемое письмо - Дата: Птн 05 Дек 2014 18:11:13 +0300 От: Дмитрий Тема: Re: Re: [PHP-DEV] Compari­son ­chain Кому: Andrea Faulds Yep, I'm saying to allow (1 < $x < 3) or ($x < $y < $z). Only in this order, I mean (1 > $x > 3) is invalid. It's really not very much point to do comp

Re: [PHP-DEV] Re: Only variables can be passed by reference

2014-12-06 Thread Christoph Becker
Yasuo Ohgaki wrote: > In languages, there are literal, constant and variable. Return value is > variable. > It's better to keep basic rule. IMHO. > > $top = array_pop(f2()); > > is better than > > $v = f2(); > $top = array_pop($v); > > Is there anyone who likes latter? > Are there any other la

Re: [PHP-DEV] Re: Only variables can be passed by reference

2014-12-06 Thread Joe Watkins
On Sat, 2014-12-06 at 12:03 +0900, Yasuo Ohgaki wrote: > Hi Rowan, > > On Fri, Dec 5, 2014 at 6:12 PM, Rowan Collins > wrote: > > > The author of function f1() presumably designed it to apply some change to > > $v, rather than executing only for its side effects and return value. If > > the call

Re: [PHP-DEV] Re: Only variables can be passed by reference

2014-12-06 Thread Patrick Schaaf
Am 06.12.2014 04:04 schrieb "Yasuo Ohgaki" : > > $top = array_pop(f2()); > > is better than > > $v = f2(); > $top = array_pop($v); > > Is there anyone who likes latter? It is bad practise either way, having poor f2() build up a whole array that is then immediately thrown away. The second case is w