Re: [PHP-DEV] Make strict mode more strict?

2015-12-28 Thread François Laupretre
Hi, Le 26/12/2015 21:35, Elijah Johnson a écrit : Can you explain your statement that this would be a huge and complex work? You must mean that there would be multiple places in the php source code where variables are assigned? I'm not yet discussing performance, but only the aspect of adding

Re: [PHP-DEV] Make strict mode more strict?

2015-12-28 Thread Elijah Johnson
Thanks, On Mon, Dec 28, 2015 at 6:34 AM, François Laupretre wrote: > Hi, > > Le 26/12/2015 21:35, Elijah Johnson a écrit : > >> Can you explain your statement that this would be a huge and complex >> work? You must mean that there would be multiple places in the php source >>

Re: [PHP-DEV] Make strict mode more strict?

2015-12-28 Thread Elijah Johnson
Some additional observations - On Mon, Dec 28, 2015 at 10:03 AM, Elijah Johnson wrote: > Thanks, > > On Mon, Dec 28, 2015 at 6:34 AM, François Laupretre > wrote: > >> Hi, >> >> Le 26/12/2015 21:35, Elijah Johnson a écrit : >> >>> Can you explain your

Re: [PHP-DEV] Make strict mode more strict?

2015-12-28 Thread Elijah Johnson
Hi (all), On Mon, Dec 28, 2015 at 3:40 PM, Yasuo Ohgaki wrote: > Hi all, > > On Tue, Dec 29, 2015 at 5:28 AM, Yasuo Ohgaki wrote: > > Object(class) is type, so it makes sense checking class consistency. If > we > > check object's class, not only the

Re: [PHP-DEV] Make strict mode more strict?

2015-12-28 Thread Yasuo Ohgaki
Hi all, On Tue, Dec 29, 2015 at 5:28 AM, Yasuo Ohgaki wrote: > Object(class) is type, so it makes sense checking class consistency. If we > check object's class, not only the class but also ancestor classes should be > checked. This may affect performance. > I'm not sure if

Re: [PHP-DEV] Make strict mode more strict?

2015-12-28 Thread Yasuo Ohgaki
Hi Elijah, On Tue, Dec 29, 2015 at 12:47 AM, Elijah Johnson wrote: > The mode "stack-mode-static-object-types" would ideally also prevent > assignment of an object with a current string value, or string placeholder > value. What I mean by placeholder value - an additional

Re: [PHP-DEV] Make strict mode more strict?

2015-12-26 Thread Elijah Johnson
Hi François, > > Hi Yasuo, >> Le 17/09/2015 00:10, Yasuo Ohgaki a écrit : >> Hi all, >> >> Assigning different type to already initialized variable is a bug most >> likely. There may be cases that variable should have several types, >> e.g. return INT for success and FALSE for

Re: [PHP-DEV] Make strict mode more strict?

2015-12-26 Thread Yasuo Ohgaki
Hi Eliah, Thank you Eliah. I was planning to discuss this next year. Following paragraph is for others. Making sure prevent confusions. I've implemented session.use_strict_mode, but this discussion is for "strict type mode". I was proposing type check for variable conversions. e.g. Raise

Re: [PHP-DEV] Make strict mode more strict?

2015-09-17 Thread Anthony Ferrara
Yasuo, On Wed, Sep 16, 2015 at 6:10 PM, Yasuo Ohgaki wrote: > Hi all, > > PHP 7 has strict_types mode for function parameters/return values and > these are binded to certain type strictly. > https://wiki.php.net/rfc/scalar_type_hints_v5 > > Why not make strict_types mode more

[PHP-DEV] Make strict mode more strict?

2015-09-16 Thread Yasuo Ohgaki
Hi all, PHP 7 has strict_types mode for function parameters/return values and these are binded to certain type strictly. https://wiki.php.net/rfc/scalar_type_hints_v5 Why not make strict_types mode more strict? The idea is as follows: Assigning different type to already initialized variable

Re: [PHP-DEV] Make strict mode more strict?

2015-09-16 Thread Rowan Collins
On 16 September 2015 23:10:55 BST, Yasuo Ohgaki wrote: >The idea is as follows: > >declare(strict_types=1); > >function foo(int &$i) { > $i = "string"; // Raise error > $i = function_returns_string(); // Raise error > $i = 1234.5678; // Raise error > $i =

Re: [PHP-DEV] Make strict mode more strict?

2015-09-16 Thread Stanislav Malyshev
Hi! > PHP 7 has strict_types mode for function parameters/return values and > these are binded to certain type strictly. > https://wiki.php.net/rfc/scalar_type_hints_v5 > > Why not make strict_types mode more strict? What you are proposing is not making strict_mode more strict, it is full

Re: [PHP-DEV] Make strict mode more strict?

2015-09-16 Thread Thomas Bley
Yasuo Ohgaki wrote on 17.09.2015 00:10: > Hi all, > > PHP 7 has strict_types mode for function parameters/return values and > these are binded to certain type strictly. > https://wiki.php.net/rfc/scalar_type_hints_v5 > > Why not make strict_types mode more strict? > The idea is as follows: > >

Re: [PHP-DEV] Make strict mode more strict?

2015-09-16 Thread François Laupretre
Hi Yasuo, Le 17/09/2015 00:10, Yasuo Ohgaki a écrit : Hi all, Assigning different type to already initialized variable is a bug most likely. There may be cases that variable should have several types, e.g. return INT for success and FALSE for failure, but programmers can use different variable