Re: [PHP-DEV] [VOTE] Void Return Type RFC

2015-11-08 Thread Pascal MARTIN, AFUP
Le 29/10/2015 01:08, Andrea Faulds a écrit : Hi everyone, The vote can be found here: https://wiki.php.net/rfc/void_return_type#vote Hi, At AFUP, we would be +1 on this RFC, mostly because adding this kind of static check could help detecting a few mistakes here and there. Thanks for

Re: [PHP-DEV] [VOTE] Void Return Type RFC

2015-11-08 Thread Andrea Faulds
Hi Pascal, Pascal MARTIN, AFUP wrote: At AFUP, we would be +1 on this RFC, mostly because adding this kind of static check could help detecting a few mistakes here and there. Thanks for your work on this, and welcome back! I'm glad you appreciate it. By the way, I think it's great that you

Re: [PHP-DEV] [VOTE] Void Return Type RFC

2015-11-05 Thread Stephen Coakley
On 10/29/2015 07:44 AM, Dan Ackroyd wrote: Hi Internals, Stanislav Malyshev wrote: every PHP function actually returns something (at least null). So this type would not actually be right and would not reflect what actually is happening. Well obviously we would need to have a followup RFC to

Re: [PHP-DEV] [VOTE] Void Return Type RFC

2015-10-30 Thread Chris Riley
Hi, I'm still not sure why we are using void as the return type and not null. Null matches behaviour, void just adds another keyword without value. ~C On 30 October 2015 at 04:33, Rasmus Lerdorf wrote: > On 10/29/2015 08:55 PM, Stanislav Malyshev wrote: > > Hi! > > > >>

Re: [PHP-DEV] [VOTE] Void Return Type RFC

2015-10-30 Thread John Bafford
There are two particular semantic advantages of void functions I’m not sure have been brought up. A function that always throws an exception can’t have a return value (and checking for one is also semantically and logically incorrect). Since such a function won’t ever return by normal means,

Re: [PHP-DEV] [VOTE] Void Return Type RFC

2015-10-30 Thread Marcio Almada
Hi, > > That's what I am having issue with. I don't see the case where such > guarantee is useful. If you're not using the return value, why do you > care if it's always null or sometimes null and sometimes baloney > sandwich? If you need always null, you have it: null. You don't need to > use

Re: [PHP-DEV] [VOTE] Void Return Type RFC

2015-10-29 Thread Dan Ackroyd
On 29 October 2015 at 12:48, Pedro Cordeiro wrote: > Like I said in a previous post, there is no need to forbid using a void > function return value. > > Throwing an E_NOTICE would be sufficient to inform the developer he's doing > something weird To me, that is not really

Re: [PHP-DEV] [VOTE] Void Return Type RFC

2015-10-29 Thread Dan Ackroyd
On 29 October 2015 at 12:52, Stanislav Malyshev wrote: > I don't think we should do either. The whole story bases on the premise > that it is very important to avoid functions that accidentally return > non-null value. I don't think we should do either. The whole story bases

Re: [PHP-DEV] [VOTE] Void Return Type RFC

2015-10-29 Thread Pedro Cordeiro
Like I said in a previous post, there is no need to forbid using a void function return value. Throwing an E_NOTICE would be sufficient to inform the developer he's doing something weird (using the return value from a function that, by definition, shouldn't have any return value) without breaking

Re: [PHP-DEV] [VOTE] Void Return Type RFC

2015-10-29 Thread Adam Harvey
On 29 October 2015 at 06:24, Marcio Almada wrote: > Welcome back, Andrea! It's great to see you contributing here again :) +1. :) > 1) functions declared with "void" return type will still return > "null", so "void" is a big fat lie for PHP while "null" is currently >

Re: [PHP-DEV] [VOTE] Void Return Type RFC

2015-10-29 Thread Dan Ackroyd
Pedro, your email client snipped off the internals CC On 29 October 2015 at 13:11, Pedro Cordeiro wrote: > If that callback is actually a void function, then using its return value IS > an error. The same way using a variable you're not sure exists, using a > return value

Re: [PHP-DEV] [VOTE] Void Return Type RFC

2015-10-29 Thread Anthony Ferrara
Dan, On Thu, Oct 29, 2015 at 9:22 AM, Dan Ackroyd wrote: > Pedro, your email client snipped off the internals CC > > On 29 October 2015 at 13:11, Pedro Cordeiro wrote: >> If that callback is actually a void function, then using its return value IS

Re: [PHP-DEV] [VOTE] Void Return Type RFC

2015-10-29 Thread Stanislav Malyshev
Hi! > type (or pseudo-type) to do this. We should add null as a return type > rather than void as null: I don't think we should do either. The whole story bases on the premise that it is very important to avoid functions that accidentally return non-null value. I do not think this premise is

Re: [PHP-DEV] [VOTE] Void Return Type RFC

2015-10-29 Thread Stanislav Malyshev
Hi! > The use case is that it allows better static analysis Any analyzer worth its bytes would know whether the function returns non-null values (as opposed to whether you declared it to return it, the former being much more useful). However, more important point that I think introducing

Re: [PHP-DEV] [VOTE] Void Return Type RFC

2015-10-29 Thread Andrea Faulds
Hi, Stanislav Malyshev wrote: Hi! There is a quite important use-case I've been informed of (alas I cannot recall who by), and it was one of the things that motivated me to revive the RFC. For interfaces, it's important to be strict in your definitions, so you don't end up with

Re: [PHP-DEV] [VOTE] Void Return Type RFC

2015-10-29 Thread Andrea Faulds
Hi Stas, Stanislav Malyshev wrote: Hi! type (or pseudo-type) to do this. We should add null as a return type rather than void as null: I don't think we should do either. The whole story bases on the premise that it is very important to avoid functions that accidentally return non-null

Re: [PHP-DEV] [VOTE] Void Return Type RFC

2015-10-29 Thread Andrea Faulds
Hi, Levi Morrison wrote: On Wed, Oct 28, 2015 at 8:17 PM, François Laupretre wrote: Hi Andrea, Le 29/10/2015 01:08, Andrea Faulds a écrit : The vote can be found here: https://wiki.php.net/rfc/void_return_type#vote Just voted +1 as, unlike some :), I like the idea of

Re: [PHP-DEV] [VOTE] Void Return Type RFC

2015-10-29 Thread Stanislav Malyshev
Hi! > There is a quite important use-case I've been informed of (alas I cannot > recall who by), and it was one of the things that motivated me to revive > the RFC. For interfaces, it's important to be strict in your > definitions, so you don't end up with implementation-defined behaviour > that

Re: [PHP-DEV] [VOTE] Void Return Type RFC

2015-10-29 Thread Stanislav Malyshev
Hi! > Well yes, but the interface description currently says that it'll return > a value of some unspecified type. That's what omitting the return type > declaration does. No, it doesn't do that. It doesn't do anything - it just provides no information. If you rely on it to return something,

Re: [PHP-DEV] [VOTE] Void Return Type RFC

2015-10-29 Thread Andreas Heigl
Am 29.10.15 um 01:44 schrieb Bob Weinand: >> Am 29.10.2015 um 01:08 schrieb Andrea Faulds : >> >> Hi everyone, >> >> It’s been two weeks, so voting on this RFC can start. The rules are as >> usual. This is a language change, so a 2/3 majority is required. >> >> The vote can be found

Re: [PHP-DEV] [VOTE] Void Return Type RFC

2015-10-29 Thread Stanislav Malyshev
Hi! > "void" or "null" as return type would give a 100% guarantee that every > possible > implementation of a given interface won't return any random value. Then it > would > make no difference if the returned value is being used or not, as it > would always > be null. > > So, it obviously

Re: [PHP-DEV] [VOTE] Void Return Type RFC

2015-10-29 Thread Rasmus Lerdorf
On 10/29/2015 08:55 PM, Stanislav Malyshev wrote: > Hi! > >> "void" or "null" as return type would give a 100% guarantee that every >> possible >> implementation of a given interface won't return any random value. Then it >> would >> make no difference if the returned value is being used or

Re: [PHP-DEV] [VOTE] Void Return Type RFC

2015-10-29 Thread Marcio Almada
Hi, 2015-10-29 17:43 GMT-03:00 Stanislav Malyshev : > Hi! > >> Well yes, but the interface description currently says that it'll return >> a value of some unspecified type. That's what omitting the return type >> declaration does. > > No, it doesn't do that. It doesn't do

Re: [PHP-DEV] [VOTE] Void Return Type RFC

2015-10-28 Thread François Laupretre
Hi Andrea, Le 29/10/2015 01:08, Andrea Faulds a écrit : The vote can be found here: https://wiki.php.net/rfc/void_return_type#vote Just voted +1 as, unlike some :), I like the idea of distinguishing void from null. Is it too late to add a note in the RFC, listing the possibility, in the

Re: [PHP-DEV] [VOTE] Void Return Type RFC

2015-10-28 Thread Levi Morrison
On Wed, Oct 28, 2015 at 8:17 PM, François Laupretre wrote: > Hi Andrea, > > Le 29/10/2015 01:08, Andrea Faulds a écrit : >> >> >> The vote can be found here: >> >> https://wiki.php.net/rfc/void_return_type#vote > > > Just voted +1 as, unlike some :), I like the idea of

Re: [PHP-DEV] [VOTE] Void Return Type RFC

2015-10-28 Thread Marcio Almada
Hi, Welcome back, Andrea! It's great to see you contributing here again :) 2015-10-28 21:08 GMT-03:00 Andrea Faulds : > Hi everyone, > > It’s been two weeks, so voting on this RFC can start. The rules are as > usual. This is a language change, so a 2/3 majority is required. > > The

[PHP-DEV] [VOTE] Void Return Type RFC

2015-10-28 Thread Andrea Faulds
Hi everyone, It’s been two weeks, so voting on this RFC can start. The rules are as usual. This is a language change, so a 2/3 majority is required. The vote can be found here: https://wiki.php.net/rfc/void_return_type#vote Voting starts today (2015-10-28) and will end next Sunday

Re: [PHP-DEV] [VOTE] Void Return Type RFC

2015-10-28 Thread Bob Weinand
> Am 29.10.2015 um 01:08 schrieb Andrea Faulds : > > Hi everyone, > > It’s been two weeks, so voting on this RFC can start. The rules are as usual. > This is a language change, so a 2/3 majority is required. > > The vote can be found here: > >