Re: [PHP-DEV] Allow non-variable arguments to empty()

2012-05-05 Thread Richard Lynch
On Thu, April 12, 2012 6:05 pm, Johannes Schlüter wrote: On Wed, 2012-04-11 at 00:53 +0200, Nikita Popov wrote: Currently the empty() language construct only works on variables. You can write if (empty($array)) but not empty if (empty(getSomeArray()). I've mentioned this thought off-list

Re: [PHP-DEV] Allow non-variable arguments to empty()

2012-05-05 Thread Richard Lynch
On Tue, April 10, 2012 5:53 pm, Nikita Popov wrote: Another reason is that currently you get a very obscure error message if you try to use empty() on a function return value: Can't use function return value in write context. Aha. Where did I try to write to the return value?! On the line

Re: [PHP-DEV] Allow non-variable arguments to empty()

2012-04-13 Thread Nikita Popov
On Fri, Apr 13, 2012 at 11:37 AM, Pal Konyves paul.kony...@gmail.com wrote: I don't see the point of empty( function() ). You tipically use empty on values that holds information you want to use later in the program flow (a string, an integer). That means you'd better extract it to a variable

Re: [PHP-DEV] Allow non-variable arguments to empty()

2012-04-13 Thread Etienne Kneuss
Hi, On Fri, Apr 13, 2012 at 15:00, Nikita Popov nikita@googlemail.com wrote: On Fri, Apr 13, 2012 at 11:37 AM, Pal Konyves paul.kony...@gmail.com wrote: I don't see the point of empty( function() ). You tipically use empty on values that holds information you want to use later in the

Re: [PHP-DEV] Allow non-variable arguments to empty()

2012-04-13 Thread Pal Konyves
Well, if you want to use empty in the above mentioned situations, you might need the change. I personally don't like using empty(). I use it only on arrays, that's because semantically fits: array is empty. In other situations I prefer comparing against the according return type because it

Re: [PHP-DEV] Allow non-variable arguments to empty()

2012-04-13 Thread Etienne Kneuss
On Fri, Apr 13, 2012 at 16:22, Pal Konyves paul.kony...@gmail.com wrote: Well, if you want to use empty in the above mentioned situations, you might need the change. I personally don't like using empty(). I use it only on arrays, that's because semantically fits: array is empty. In other

Re: [PHP-DEV] Allow non-variable arguments to empty()

2012-04-12 Thread Johannes Schlüter
On Wed, 2012-04-11 at 00:53 +0200, Nikita Popov wrote: Currently the empty() language construct only works on variables. You can write if (empty($array)) but not empty if (empty(getSomeArray()). I've mentioned this thought off-list already but let's discuss it officially: A fear I have is

Re: [PHP-DEV] Allow non-variable arguments to empty()

2012-04-10 Thread Jelle Zijlstra
2012/4/10 Nikita Popov nikita@googlemail.com Hey internals! Currently the empty() language construct only works on variables. You can write if (empty($array)) but not empty if (empty(getSomeArray()). The original reason for this restriction probably is that - in a way - it doesn't make

Re: [PHP-DEV] Allow non-variable arguments to empty()

2012-04-10 Thread Xinchen Hui
Sent from my iPad 在 2012-4-11,6:54,Nikita Popov nikita@googlemail.com 写道: Hey internals! Currently the empty() language construct only works on variables. You can write if (empty($array)) but not empty if (empty(getSomeArray()). The original reason for this restriction probably is that

Re: [PHP-DEV] Allow non-variable arguments to empty()

2012-04-10 Thread Kris Craig
On Tue, Apr 10, 2012 at 10:12 PM, Stas Malyshev smalys...@sugarcrm.comwrote: Hi! Well, technically it's discussion /and/ vote. I know we've been wanting to get out of the habit of push first, ask later, which is precisely what RFC helps us avoid. Personally, I think any commits for a