Re: [PHP-DEV] [RFC] Optional typehint check for parameters

2018-07-17 Thread Zeljko Mitic
On Tue, Jul 17, 2018 at 3:39 PM Dan Ackroyd wrote: > On 17 July 2018 at 13:08, Zeljko Mitic wrote: > > > > It won't help, preprocess.io doesn't remove typehints. > > It doesn't _currently_ remove parameter types. > > If you think this is an idea worth doing, you coul

Re: [PHP-DEV] [RFC] Optional typehint check for parameters

2018-07-17 Thread Zeljko Mitic
On Tue, Jul 17, 2018 at 1:18 PM Dan Ackroyd wrote: > On 15 July 2018 at 20:39, Zeljko Mitic wrote: > > PHP is dynamic language and each typed typehinted parameter has to be > > checked every time. > > If you think your code would benefit appreciably from having paramet

Re: [PHP-DEV] [RFC] Optional typehint check for parameters

2018-07-16 Thread Zeljko Mitic
On Mon, Jul 16, 2018 at 1:42 PM Rowan Collins wrote: > On 16 July 2018 at 12:06, Arvids Godjuks wrote: > >> Basically, you went wrong when you proposed a switch that controlls >> language behavior. To add to that - a switch that probably is not >> controllable by code that is running. >> > > >

[PHP-DEV] [RFC] Optional typehint check for parameters

2018-07-15 Thread Zeljko Mitic
PHP is dynamic language and each typed typehinted parameter has to be checked every time. I am suggesting new php.ini value "typecheck.enable = 1" which can be turned off. Example: with default php config, a code like this would check each member of $users array: function demo(User ...$users) {}

Re: [PHP-DEV] [RFC] Optional typehint check for parameters

2018-07-16 Thread Zeljko Mitic
uks wrote: > On Sun, Jul 15, 2018, 22:45 Zeljko Mitic wrote: > >> PHP is dynamic language and each typed typehinted parameter has to be >> checked every time. I am suggesting new php.ini value "typecheck.enable = >> 1" which can be turned off. >> >>

Re: [PHP-DEV] [RFC] Optional typehint check for parameters

2018-07-16 Thread Zeljko Mitic
On Mon, Jul 16, 2018 at 12:56 PM Zeljko Mitic wrote: > I tried to, but I honestly can't see the problem. No decent programmer > makes error by sending wrong type of parameter and this feature is 100% > optional. I know for sure that even in my dev computer, I would use this

Re: [PHP-DEV] [RFC] Optional typehint check for parameters

2018-07-16 Thread Zeljko Mitic
On Mon, Jul 16, 2018 at 1:06 PM Arvids Godjuks wrote: > пн, 16 июл. 2018 г. в 13:56, Zeljko Mitic : > >> I tried to, but I honestly can't see the problem. No decent programmer >> makes error by sending wrong type of parameter and this feature is 100% >> optional. I know

Re: [PHP-DEV] [RFC] Optional typehint check for parameters

2018-07-16 Thread Zeljko Mitic
On Mon, Jul 16, 2018 at 1:14 PM Nikita Popov wrote: > On Sun, Jul 15, 2018 at 9:39 PM, Zeljko Mitic wrote: > >> PHP is dynamic language and each typed typehinted parameter has to be >> checked every time. I am suggesting new php.ini value "typecheck.enable = >&g

Re: [PHP-DEV] [RFC] Optional typehint check for parameters

2018-07-16 Thread Zeljko Mitic
On Mon, Jul 16, 2018 at 1:44 PM Zeljko Mitic wrote: > > > On Mon, Jul 16, 2018 at 1:14 PM Nikita Popov wrote: > >> On Sun, Jul 15, 2018 at 9:39 PM, Zeljko Mitic wrote: >> >>> PHP is dynamic language and each typed typehinted parameter has to be >>&g