[PHP-DEV] Stricter implicit boolean coercions

2022-04-26 Thread Andreas Leathley
Hello Internals, Implicit type coercions (when not using strict_types) have become increasingly less lossy/surprising in PHP, especially coercions to integer and float, where you get a TypeError if you pass a non-numeric string to an integer parameter, and a deprecation notice if you pass a

[PHP-DEV] Re: Stricter implicit boolean coercions

2022-04-26 Thread Mark Randall
On 26/04/2022 10:54, Andreas Leathley wrote: Any non-empty string (except "0") is converted to true and any non-zero integer or float is converted to true. If we could get rid of "0" being false, that alone would be a huge benefit for the language in the long run. I know why it exists, but

Re: [PHP-DEV] Re: Stricter implicit boolean coercions

2022-04-26 Thread Andreas Leathley
On 26.04.22 12:02, Mark Randall wrote: On 26/04/2022 10:54, Andreas Leathley wrote: Any non-empty string (except "0") is converted to true and any non-zero integer or float is converted to true. If we could get rid of "0" being false, that alone would be a huge benefit for the language in the

Re: [PHP-DEV] PHP 8.2 Release Manager Selection

2022-04-26 Thread Christoph M. Becker
On 26.04.2022 at 17:21, Aaron Junker wrote: > I have some interest in doing this. I think I know PHP and git very well and > I also know more or less how the PHP internal processes work. However I have > two doubts/questions: > > 1. How much time do I need for this task? I can't really estimate

Re: [PHP-DEV] PHP 8.2 Release Manager Selection

2022-04-26 Thread Aaron Junker
Hi internals After answering my questions (Thanks Christoph) I would like to pose my application as release manager. I'm a 17 year old college student from Switzerland. I've experience in triaging issues and GitHub from triaging the Microsoft PowerToys repository [1][2] and the

Re: [PHP-DEV] NULL Coercion Consistency

2022-04-26 Thread Guilliam Xavier
On Tue, Apr 26, 2022 at 12:18 AM Larry Garfield wrote: > On Mon, Apr 25, 2022, at 4:07 PM, Rowan Tommins wrote: > > > Off the top of my head, I don't know what other inconsistencies remain, > > but my point was that in every case so far, internal functions have been > > adapted to match

Re: [PHP-DEV] Stricter implicit boolean coercions

2022-04-26 Thread Alexandru Pătrănescu
On Tue, Apr 26, 2022 at 12:54 PM Andreas Leathley wrote: > Hello Internals, > > Implicit type coercions (when not using strict_types) have become > increasingly less lossy/surprising in PHP, especially coercions to > integer and float, where you get a TypeError if you pass a non-numeric > string

[PHP-DEV] Re: Add another php syntax for simplify code

2022-04-26 Thread Christoph M. Becker
On 26.04.2022 at 06:02, chopins xiao wrote: > 0. when dot object opeator is enable, use small sign and add sign [<+] be > equivalent to [.] for string concat mark. > compatibility is achieved through configuration switches. > syntax : > >>> $a = 'str0'; > >>> $a .=

[PHP-DEV] Re: PHP 8.2 Release Manager Selection

2022-04-26 Thread Christoph M. Becker
On 26.04.2022 at 12:31, Mark Randall wrote: > On 25/04/2022 12:51, Christoph M. Becker wrote: > >> Please put your name forward here if you wish to be considered a >> candidate.  An initial TODO page has been added to the wiki and contains >> provisional dates for GA and pre-releases[2]. > > I

Re: [PHP-DEV] Stricter implicit boolean coercions

2022-04-26 Thread Rowan Tommins
Am 26.04.2022 um 11:54 schrieb Andreas Leathley: I have not found any past proposals or discussions to change boolean coercions, so I would like to find out how the thoughts on internals are to change this, or if there are any reasons not to change this that I have not thought of. I was

Re: [PHP-DEV] Stricter implicit boolean coercions

2022-04-26 Thread Christian Schneider
Am 26.04.2022 um 11:54 schrieb Andreas Leathley : > I have not found any past proposals or discussions to change boolean > coercions, so I would like to find out how the thoughts on internals are > to change this, or if there are any reasons not to change this that I > have not thought of. There

[PHP-DEV] Re: PHP 8.2 Release Manager Selection

2022-04-26 Thread Mark Randall
On 25/04/2022 12:51, Christoph M. Becker wrote: Please put your name forward here if you wish to be considered a candidate. An initial TODO page has been added to the wiki and contains provisional dates for GA and pre-releases[2]. I could potentially be interested in helping out with this,

Re: [PHP-DEV] Stricter implicit boolean coercions

2022-04-26 Thread Andreas Leathley
On 26.04.22 14:47, Christian Schneider wrote: There are two big reasons: - BC: Checking for the truthiness of a value is very common and would require a lot of code changes. - Some of us like the conciseness of "if ($foo) ...", see below That would not be my target - in an if expression a lot

Re: [PHP-DEV] Stricter implicit boolean coercions

2022-04-26 Thread Andreas Leathley
On 26.04.22 15:27, Rowan Tommins wrote: I was actually thinking about this the other day, in the context of adding new cast functions which reject more values than our current explicit casts. This is also something I am interested in - having functions which do the same as implicit type

Re: [PHP-DEV] Stricter implicit boolean coercions

2022-04-26 Thread Christian Schneider
Am 26.04.2022 um 15:16 schrieb Andreas Leathley : > On 26.04.22 14:47, Christian Schneider wrote: >> There are two big reasons: >> - BC: Checking for the truthiness of a value is very common and would >> require a lot of code changes. >> - Some of us like the conciseness of "if ($foo) ...", see

Re: [PHP-DEV] PHP 8.2 Release Manager Selection

2022-04-26 Thread Evan Sims via internals
Hello! I'd be eager for the opportunity to be involved as a release manager, and contributing to the PHP community I've made built my career around. I've been a PHP developer since 2000 (with the release of PHP4), and although I do not work in C in my day to day anymore, I cut my programmer teeth

Re: [PHP-DEV] Stricter implicit boolean coercions

2022-04-26 Thread Rowan Tommins
On 26/04/2022 14:53, Andreas Leathley wrote: 'on' is only true by "accident" though, because it is a non-empty string, not because of its meaning, and then it is likely that the value 'off' could also be added at some point - which also would be true. The reason I gave that particular

Re: [PHP-DEV] PHP 8.2 Release Manager Selection

2022-04-26 Thread Aaron Junker
Hi Internals I have some interest in doing this. I think I know PHP and git very well and I also know more or less how the PHP internal processes work. However I have two doubts/questions: 1. How much time do I need for this task? I can't really estimate this. I sure have would have some time

Re: [PHP-DEV] Stricter implicit boolean coercions

2022-04-26 Thread Mel Dafert
>I see, so as long as there are no bool type hints for function parameters >everything would be the same. > >This would lead to a minor asymmetry for > $preserve = "yes"; > if ($preserve) # Silently working, true > array_slice($array, $offset, preserve_keys:

Re: [PHP-DEV] PHP 8.2 Release Manager Selection

2022-04-26 Thread Calvin Buckley
On Mon, 2022-04-25 at 13:51 +0200, Christoph M. Becker wrote: > > Please put your name forward here if you wish to be considered a > candidate.  An initial TODO page has been added to the wiki and > contains > provisional dates for GA and pre-releases[2]. > I'll put my name in the hat for

[PHP-DEV] PHP 8.2 Release Manager Selection

2022-04-26 Thread Sergey Panteleev
Hey Christoph, Do we choose one rookie for this release or two (as for 8.1)? Also, maybe define some kind of deadline for submitting applications and the voting phase, thoughts? — wbr, Sergey Panteleev

Re: [PHP-DEV] Stricter implicit boolean coercions

2022-04-26 Thread Rowan Tommins
On 26/04/2022 14:53, Andreas Leathley wrote: This is also something I am interested in - having functions which do the same as implicit type casts, so something like "coerce_to_int('hello')" would lead to a TypeError like it would when passing it to an int parameter, and maybe

Re: [PHP-DEV] PHP 8.2 Release Manager Selection

2022-04-26 Thread Eric Mann via internals
I'm new to this mailing list as I'd previously (and very mistakenly) assumed it was meant for existing contributors. So I've always consumed conversations via web-based aggregators rather than directly. My mistake. That being said, I am very interested in being a part of this release. I've

Re: [PHP-DEV] NULL Coercion Consistency

2022-04-26 Thread Rowan Tommins
On 26/04/2022 17:36, Guilliam Xavier wrote: function mt_rand(int $min = UNKNOWN, int $max = UNKNOWN): int {} documented with two signatures at https://www.php.net/manual/en/function.mt-rand.php mt_rand(): int mt_rand(int $min, int $max): int This is actually a really

Re: [PHP-DEV] PHP 8.2 Release Manager Selection

2022-04-26 Thread Joe Watkins
Hi all, Applications are open for a week. Two people will be chosen by election and a veteran will help them. If no other veteran comes forward I will continue in that role for 8.2. Cheers Joe On Tue, 26 Apr 2022, 21:21 Eric Mann via internals, wrote: > I'm new to this mailing list as I'd