Re: [PHP-DEV] About declare(strict_types = 1)

2015-03-17 Thread Peter Petermann
On March 16, 2015 11:10:41 PM GMT+01:00, Pierre Joye pierre@gmail.com wrote: On Mar 17, 2015 7:05 AM, Peter Petermann ppeterman...@gmail.com wrote: On March 16, 2015 2:32:39 PM GMT+01:00, Pascal Chevrel pascal.chev...@free.fr wrote: It's too late, Bob's Basic STH missed the schedule

Re: [PHP-DEV] About declare(strict_types = 1)

2015-03-16 Thread Yasuo Ohgaki
Hi Mike, On Tue, Mar 17, 2015 at 5:03 AM, Mike Willbanks pen...@gmail.com wrote: Let see how it looks if strict_types is renamed to raise_type_error ?php declare(raise_type_error = 1); function foo(int $a) { // no function call here } ? The declare here

Re: [PHP-DEV] About declare(strict_types = 1)

2015-03-16 Thread Pascal Chevrel
Le 16/03/2015 12:39, Xinchen Hui a écrit : Hey: And last comment, if there no such declare thing, I will definitely vote yes to this RFC. Hi Xinchen, You can also not vote at all, that's a very valid option. By voting yes, you say that you want PHP developers to have access to STH in

Re: [PHP-DEV] About declare(strict_types = 1)

2015-03-16 Thread Xinchen Hui
Hey: On Mon, Mar 16, 2015 at 9:32 PM, Pascal Chevrel pascal.chev...@free.fr wrote: Le 16/03/2015 12:39, Xinchen Hui a écrit : Hey: And last comment, if there no such declare thing, I will definitely vote yes to this RFC. Hi Xinchen, You can also not vote at all, that's a very valid

Re: [PHP-DEV] About declare(strict_types = 1)

2015-03-16 Thread David Muir
On 16 Mar 2015, at 11:16 pm, Pavel Kouřil pajou...@gmail.com wrote: On Mon, Mar 16, 2015 at 1:04 PM, Dan Ackroyd dan...@basereality.com wrote: On 16 March 2015 at 11:49, Pavel Kouřil pajou...@gmail.com wrote: Seriously, think about it for a while - when some setting that changes how

Re: [PHP-DEV] About declare(strict_types = 1)

2015-03-16 Thread Yasuo Ohgaki
Hi Pierre, On Mon, Mar 16, 2015 at 5:17 PM, Pierre Joye pierre@gmail.com wrote: On Mar 16, 2015 6:46 PM, Yasuo Ohgaki yohg...@ohgaki.net wrote: Hi Dennis, On Mon, Mar 16, 2015 at 3:33 PM, Dennis Birkholz den...@birkholz.biz wrote: Am 16.03.2015 um 07:22 schrieb Yasuo Ohgaki:

Re: [PHP-DEV] About declare(strict_types = 1)

2015-03-16 Thread Xinchen Hui
Hey: On Mon, Mar 16, 2015 at 7:33 PM, Yasuo Ohgaki yohg...@ohgaki.net wrote: Hi Derick, On Mon, Mar 16, 2015 at 8:18 PM, Derick Rethans der...@php.net wrote: On Mon, 16 Mar 2015, Xinchen Hui wrote: On Mon, Mar 16, 2015 at 5:00 PM, Pierre Joye pierre@gmail.com wrote: On Mar

Re: [PHP-DEV] About declare(strict_types = 1)

2015-03-16 Thread Pavel Kouřil
This RFC will have serious consequence. We made mistake with safe_mode. The main reason it failed is it did not force caller to have responsibility to make it work as it should. This RFC does the same for how declare(strict_types=1) works. Aren't we learned from safe_mode lessons? I am

Re: [PHP-DEV] About declare(strict_types = 1)

2015-03-16 Thread Derick Rethans
On Mon, 16 Mar 2015, Jordi Boggiano wrote: On 16/03/2015 11:49, Pavel Kouřil wrote: it's similiar to the safe_mode though. Sure, it's not as bad as INI setting, but the intent is the same - a switch changing how code behaves. ini_set('memory_limit', 10); also changes how your code

Re: [PHP-DEV] About declare(strict_types = 1)

2015-03-16 Thread Yasuo Ohgaki
Hi Derick, On Mon, Mar 16, 2015 at 8:18 PM, Derick Rethans der...@php.net wrote: On Mon, 16 Mar 2015, Xinchen Hui wrote: On Mon, Mar 16, 2015 at 5:00 PM, Pierre Joye pierre@gmail.com wrote: On Mar 16, 2015 4:29 PM, Xinchen Hui larue...@php.net wrote: that means, I need

Re: [PHP-DEV] About declare(strict_types = 1)

2015-03-16 Thread Xinchen Hui
Hey: On Mon, Mar 16, 2015 at 7:18 PM, Derick Rethans der...@php.net wrote: On Mon, 16 Mar 2015, Xinchen Hui wrote: On Mon, Mar 16, 2015 at 5:00 PM, Pierre Joye pierre@gmail.com wrote: On Mar 16, 2015 4:29 PM, Xinchen Hui larue...@php.net wrote: that means, I need to add a lots

Re: [PHP-DEV] About declare(strict_types = 1)

2015-03-16 Thread Dan Ackroyd
On 16 March 2015 at 11:49, Pavel Kouřil pajou...@gmail.com wrote: Seriously, think about it for a while - when some setting that changes how code behaves was a good idea? The problem is that there are two irreconcilable camps - some people want weak STHs, other people want strict STHs. This

Re: [PHP-DEV] About declare(strict_types = 1)

2015-03-16 Thread Derick Rethans
On Mon, 16 Mar 2015, Yasuo Ohgaki wrote: On Mon, Mar 16, 2015 at 8:18 PM, Derick Rethans der...@php.net wrote: On Mon, 16 Mar 2015, Xinchen Hui wrote: On Mon, Mar 16, 2015 at 5:00 PM, Pierre Joye pierre@gmail.com wrote: On Mar 16, 2015 4:29 PM, Xinchen Hui larue...@php.net

Re: [PHP-DEV] About declare(strict_types = 1)

2015-03-16 Thread Derick Rethans
On Mon, 16 Mar 2015, Yasuo Ohgaki wrote: On Mon, Mar 16, 2015 at 5:17 PM, Pierre Joye pierre@gmail.com wrote: On Mar 16, 2015 6:46 PM, Yasuo Ohgaki yohg...@ohgaki.net wrote: On Mon, Mar 16, 2015 at 3:33 PM, Dennis Birkholz den...@birkholz.biz wrote: Am 16.03.2015 um 07:22

Re: [PHP-DEV] About declare(strict_types = 1)

2015-03-16 Thread Jordi Boggiano
On 16/03/2015 11:49, Pavel Kouřil wrote: it's similiar to the safe_mode though. Sure, it's not as bad as INI setting, but the intent is the same - a switch changing how code behaves. ini_set('memory_limit', 10); also changes how your code behave, but it's global so that can be problematic.

Re: [PHP-DEV] About declare(strict_types = 1)

2015-03-16 Thread Dan Ackroyd
On 16 March 2015 at 09:05, Xinchen Hui larue...@php.net wrote: Hey: I don't like strict_types at all.. And you would never be forced to use them. But you're voting against allowing anyone else to use them. :-( cheers Dan -- PHP Internals - PHP Runtime Development Mailing List To

Re: [PHP-DEV] About declare(strict_types = 1)

2015-03-16 Thread Xinchen Hui
On Mon, Mar 16, 2015 at 7:32 PM, Xinchen Hui larue...@php.net wrote: Hey: On Mon, Mar 16, 2015 at 7:18 PM, Derick Rethans der...@php.net wrote: On Mon, 16 Mar 2015, Xinchen Hui wrote: On Mon, Mar 16, 2015 at 5:00 PM, Pierre Joye pierre@gmail.com wrote: On Mar 16, 2015 4:29 PM,

Re: [PHP-DEV] About declare(strict_types = 1)

2015-03-16 Thread Nikita Nefedov
On Mon, 16 Mar 2015 14:33:00 +0300, Yasuo Ohgaki yohg...@ohgaki.net wrote: Hi Derick, On Mon, Mar 16, 2015 at 8:18 PM, Derick Rethans der...@php.net wrote: To be frank, I don't think I don't like this is a terribly good reason to vote against (or for something). What is important is how

Re: [PHP-DEV] About declare(strict_types = 1)

2015-03-16 Thread Anton Osrdek
On Mon, Mar 16, 2015 at 12:49 PM, Pavel Kouřil pajou...@gmail.com wrote: Hello, it's similiar to the safe_mode though. Sure, it's not as bad as INI setting, but the intent is the same - a switch changing how code behaves. When I talked about the Dual Mode with some friends who are userland

Re: [PHP-DEV] About declare(strict_types = 1)

2015-03-16 Thread Nikita Nefedov
On Mon, 16 Mar 2015 14:50:16 +0300, Yasuo Ohgaki yohg...@ohgaki.net wrote: I already showed real world example how this could be fail. If we need this kind of behavior. I would suggest to have type affinity like SQLite for $_GET/$_POST/$_COOKIE. https://www.sqlite.org/datatype3.html This

Re: [PHP-DEV] About declare(strict_types = 1)

2015-03-16 Thread Derick Rethans
On Mon, 16 Mar 2015, Pavel Kouřil wrote: This RFC will have serious consequence. We made mistake with safe_mode. The main reason it failed is it did not force caller to have responsibility to make it work as it should. This RFC does the same for how declare(strict_types=1) works.

Re: [PHP-DEV] About declare(strict_types = 1)

2015-03-16 Thread Lee Davis
On Mon, Mar 16, 2015 at 11:33 AM, Yasuo Ohgaki yohg...@ohgaki.net wrote: Hi Derick, On Mon, Mar 16, 2015 at 8:18 PM, Derick Rethans der...@php.net wrote: On Mon, 16 Mar 2015, Xinchen Hui wrote: On Mon, Mar 16, 2015 at 5:00 PM, Pierre Joye pierre@gmail.com wrote: On Mar

Re: [PHP-DEV] About declare(strict_types = 1)

2015-03-16 Thread Yasuo Ohgaki
On Mon, Mar 16, 2015 at 8:44 PM, Nikita Nefedov inefe...@gmail.com wrote: On Mon, 16 Mar 2015 14:33:00 +0300, Yasuo Ohgaki yohg...@ohgaki.net wrote: Hi Derick, On Mon, Mar 16, 2015 at 8:18 PM, Derick Rethans der...@php.net wrote: To be frank, I don't think I don't like this is a

Re: [PHP-DEV] About declare(strict_types = 1)

2015-03-16 Thread Derick Rethans
On Mon, 16 Mar 2015, Xinchen Hui wrote: And last comment, if there no such declare thing, I will definitely vote yes to this RFC. that's why I want vote no for this, and wait for Bob's Basic STH. That will not be in PHP 7.0 though, as the deadline passed. And I can probably bet on that

Re: [PHP-DEV] About declare(strict_types = 1)

2015-03-16 Thread Pavel Kouřil
On Mon, Mar 16, 2015 at 1:04 PM, Dan Ackroyd dan...@basereality.com wrote: On 16 March 2015 at 11:49, Pavel Kouřil pajou...@gmail.com wrote: Seriously, think about it for a while - when some setting that changes how code behaves was a good idea? The problem is that there are two

Re: [PHP-DEV] About declare(strict_types = 1)

2015-03-16 Thread Pierre Joye
On Mar 17, 2015 7:05 AM, Peter Petermann ppeterman...@gmail.com wrote: On March 16, 2015 2:32:39 PM GMT+01:00, Pascal Chevrel pascal.chev...@free.fr wrote: It's too late, Bob's Basic STH missed the schedule for PHP 7, it was proposed way too late and the coercive STH RFC has just zero

Re: [PHP-DEV] About declare(strict_types = 1)

2015-03-16 Thread Pierre Joye
On Mar 16, 2015 11:16 PM, Pavel Kouřil pajou...@gmail.com wrote: I can't speak for anyone who voted, but personally, if I could vote, I would voted no - not because I don't want to block people from getting what they want, but because I sincerely think that having ANY setting that changes

Re: [PHP-DEV] About declare(strict_types = 1)

2015-03-16 Thread Pavel Kouřil
On Mon, Mar 16, 2015 at 11:04 PM, Pierre Joye pierre@gmail.com wrote: On Mar 16, 2015 11:16 PM, Pavel Kouřil pajou...@gmail.com wrote: I can't speak for anyone who voted, but personally, if I could vote, I would voted no - not because I don't want to block people from getting what they

Re: [PHP-DEV] About declare(strict_types = 1)

2015-03-16 Thread Pierre Joye
On Mar 16, 2015 11:07 PM, Jordi Boggiano j.boggi...@seld.be wrote: On 16/03/2015 11:49, Pavel Kouřil wrote: it's similiar to the safe_mode though. Sure, it's not as bad as INI setting, but the intent is the same - a switch changing how code behaves. ini_set('memory_limit', 10); also

Re: [PHP-DEV] About declare(strict_types = 1)

2015-03-16 Thread Yasuo Ohgaki
Hi all, On Mon, Mar 16, 2015 at 3:03 PM, Matthew Leverton lever...@gmail.com wrote: On Mon, Mar 16, 2015 at 12:55 AM, Xinchen Hui larue...@php.net wrote: That is why I don't see it before (thousand times, too long to read... but not in RFC) It's in the RFC: Whether or not the function

Re: [PHP-DEV] About declare(strict_types = 1)

2015-03-16 Thread Dennis Birkholz
Hi Yasuo, Am 16.03.2015 um 07:22 schrieb Yasuo Ohgaki: Caller _must_ satisfy callee requirements. This is simple principle to write a secure code. With this RFC, caller overrides security related setting. This means scripts that are prepared for type safety is ignored and it leads security

Re: [PHP-DEV] About declare(strict_types = 1)

2015-03-16 Thread Matthew Leverton
On Mon, Mar 16, 2015 at 12:55 AM, Xinchen Hui larue...@php.net wrote: That is why I don't see it before (thousand times, too long to read... but not in RFC) It's in the RFC: Whether or not the function being called was declared in a file that uses strict or weak type checking is irrelevant. The

Re: [PHP-DEV] About declare(strict_types = 1)

2015-03-16 Thread Yasuo Ohgaki
Hi Dennis, On Mon, Mar 16, 2015 at 3:33 PM, Dennis Birkholz den...@birkholz.biz wrote: Am 16.03.2015 um 07:22 schrieb Yasuo Ohgaki: Caller _must_ satisfy callee requirements. This is simple principle to write a secure code. With this RFC, caller overrides security related setting. This

Re: [PHP-DEV] About declare(strict_types = 1)

2015-03-16 Thread Yasuo Ohgaki
Hi all, On Mon, Mar 16, 2015 at 2:49 PM, Dennis Birkholz den...@birkholz.biz wrote: Am 16.03.2015 um 06:28 schrieb Xinchen Hui: lib.php ?php declare(strict_types = 1); function add(int $a, int $b) { } ?php add($_GET['a'], $_GET['b']);

Re: [PHP-DEV] About declare(strict_types = 1)

2015-03-16 Thread Derick Rethans
On Mon, 16 Mar 2015, Xinchen Hui wrote: On Mon, Mar 16, 2015 at 5:00 PM, Pierre Joye pierre@gmail.com wrote: On Mar 16, 2015 4:29 PM, Xinchen Hui larue...@php.net wrote: that means, I need to add a lots of (int) while I try to call a function in a library which is not written

Re: [PHP-DEV] About declare(strict_types = 1)

2015-03-16 Thread Pavel Kouřil
On Monday, March 16, 2015, Derick Rethans der...@php.net wrote: On Mon, 16 Mar 2015, Jordi Boggiano wrote: On 16/03/2015 11:49, Pavel Kouřil wrote: it's similiar to the safe_mode though. Sure, it's not as bad as INI setting, but the intent is the same - a switch changing how code behaves.

Re: [PHP-DEV] About declare(strict_types = 1)

2015-03-16 Thread Peter Petermann
On March 16, 2015 2:32:39 PM GMT+01:00, Pascal Chevrel pascal.chev...@free.fr wrote: It's too late, Bob's Basic STH missed the schedule for PHP 7, it was proposed way too late and the coercive STH RFC has just zero chance to pass, it's too much of a BC break for everybody. The dual mode STH

Re: [PHP-DEV] About declare(strict_types = 1)

2015-03-16 Thread Mike Willbanks
On Mon, Mar 16, 2015 at 2:12 PM, Yasuo Ohgaki yohg...@ohgaki.net wrote: Hi all, On Mon, Mar 16, 2015 at 2:49 PM, Dennis Birkholz den...@birkholz.biz wrote: Am 16.03.2015 um 06:28 schrieb Xinchen Hui: lib.php ?php declare(strict_types = 1); function

Re: [PHP-DEV] About declare(strict_types = 1)

2015-03-16 Thread Pierre Joye
On Mar 16, 2015 6:46 PM, Yasuo Ohgaki yohg...@ohgaki.net wrote: Hi Dennis, On Mon, Mar 16, 2015 at 3:33 PM, Dennis Birkholz den...@birkholz.biz wrote: Am 16.03.2015 um 07:22 schrieb Yasuo Ohgaki: Caller _must_ satisfy callee requirements. This is simple principle to write a secure

Re: [PHP-DEV] About declare(strict_types = 1)

2015-03-16 Thread Lester Caine
On 16/03/15 06:22, Xinchen Hui wrote: It's in the RFC: Whether or not the function being called was declared in a file that uses strict or weak type checking is irrelevant. The type checking mode depends on the file where the function is called. my fault, I must oversight of reading

Re: [PHP-DEV] About declare(strict_types = 1)

2015-03-16 Thread Pierre Joye
Hi, On Mar 16, 2015 4:29 PM, Xinchen Hui larue...@php.net wrote: Hey: The most unaccept feature in current STH thing(v.5.0) is this. acutaly, I believe in most applications, they will still keep this off.. so why we introduce such thing? beside this, I have a

Re: [PHP-DEV] About declare(strict_types = 1)

2015-03-16 Thread Xinchen Hui
Hey: On Mon, Mar 16, 2015 at 5:00 PM, Pierre Joye pierre@gmail.com wrote: Hi, On Mar 16, 2015 4:29 PM, Xinchen Hui larue...@php.net wrote: Hey: The most unaccept feature in current STH thing(v.5.0) is this. acutaly, I believe in most applications, they will still keep this

[PHP-DEV] About declare(strict_types = 1)

2015-03-15 Thread Xinchen Hui
Hey: The most unaccept feature in current STH thing(v.5.0) is this. acutaly, I believe in most applications, they will still keep this off.. so why we introduce such thing? beside this, I have a question, which is not explained in the RFC: lib.php ?php

Re: [PHP-DEV] About declare(strict_types = 1)

2015-03-15 Thread Dennis Birkholz
Hello Xinchen, Am 16.03.2015 um 06:28 schrieb Xinchen Hui: lib.php ?php declare(strict_types = 1); function add(int $a, int $b) { } ?php add($_GET['a'], $_GET['b']); that means, I need to add a lots of (int) while I try to call a

Re: [PHP-DEV] About declare(strict_types = 1)

2015-03-15 Thread Xinchen Hui
Hey: On Mon, Mar 16, 2015 at 1:49 PM, Dennis Birkholz den...@birkholz.biz wrote: Hello Xinchen, Am 16.03.2015 um 06:28 schrieb Xinchen Hui: lib.php ?php declare(strict_types = 1); function add(int $a, int $b) { } ?php add($_GET['a'],