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 lin

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 though

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 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 situations I prefer co

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 improve

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 wrote: > On Fri, Apr 13, 2012 at 11:37 AM, Pal Konyves 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

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 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 because you want

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

2012-04-13 Thread Pal Konyves
> Hi! > > "The original reason for this restriction probably is that - in a way - > it "doesn't make sense" to pass anything but a variable to empty()" > > 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 progr

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 Kris Craig
On Tue, Apr 10, 2012 at 10:31 PM, Pierre Joye wrote: > hi Kris, > > On Wed, Apr 11, 2012 at 7:26 AM, Kris Craig wrote: > > > I must've missed that part. Who was it that said this would be a > separate > > forked project? If so, then yeah obviously it's not up to us one way or > > another. And

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

2012-04-10 Thread Pierre Joye
hi Kris, On Wed, Apr 11, 2012 at 7:26 AM, Kris Craig wrote: > I must've missed that part.  Who was it that said this would be a separate > forked project?  If so, then yeah obviously it's not up to us one way or > another.  And if he's just committing changes locally and/or pushing to an > unmer

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 wrote: > 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 > > Nobody's pu

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

2012-04-10 Thread Stas Malyshev
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 Nobody's pushing anything. We're talking about implementing it in a fork, it's

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

2012-04-10 Thread Kris Craig
On Tue, Apr 10, 2012 at 5:46 PM, Stas Malyshev wrote: > Hi! > > > Err isn't this something that should go through the RFC process first? > > I think it's a good idea and I'll probably vote for it, but as I > > understand the RFC process was created specifically for stuff like this. > > One doesn't

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

2012-04-10 Thread Stas Malyshev
Hi! > Err isn't this something that should go through the RFC process first? > I think it's a good idea and I'll probably vote for it, but as I > understand the RFC process was created specifically for stuff like this. One doesn't preclude the other. Pull is code, RFC is discussion, they can go

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 写道: > 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 "

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

2012-04-10 Thread Kris Craig
On Tue, Apr 10, 2012 at 4:51 PM, Stas Malyshev wrote: > Hi! > > > 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 "d

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

2012-04-10 Thread Stas Malyshev
Hi! > 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 sense" to pass anything but a variable to empty() as >

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

2012-04-10 Thread Jelle Zijlstra
2012/4/10 Johannes Schlüter > On Tue, 2012-04-10 at 19:12 -0400, Jelle Zijlstra wrote: > > I think this is a useful simplification of the language, removing an > > unnecessary exception. Would it also make sense to make empty() into a > > library function instead of a language construct? That wou

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

2012-04-10 Thread Johannes Schlüter
On Tue, 2012-04-10 at 19:12 -0400, Jelle Zijlstra wrote: > I think this is a useful simplification of the language, removing an > unnecessary exception. Would it also make sense to make empty() into a > library function instead of a language construct? That would not > result in > any BC break as f

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

2012-04-10 Thread Kris Craig
On Tue, Apr 10, 2012 at 4:12 PM, Jelle Zijlstra wrote: > 2012/4/10 Nikita Popov > > > 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 restric

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

2012-04-10 Thread Jelle Zijlstra
2012/4/10 Nikita Popov > 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 sense" to pass an