Re: [PHP-DEV] Re: [VOTE] Userspace operator overloading

2020-03-26 Thread Guilliam Xavier
On Thu, Mar 26, 2020 at 5:37 PM wrote: > > The overloaded concat operator has higher priority than the __toString() > method. > So if Class A overloades the concat operator, then calling $a . $b means > ClassA::__concat($a, $b); (Note that both operands are passed in their > original form) >

Re: [PHP-DEV] [RFC] Constructor Property Promotion

2020-03-26 Thread Nikita Popov
On Thu, Mar 26, 2020 at 5:02 PM David Rodrigues wrote: > Hello! > > With all respect, seems a bit confuses to me, without in fact offer a new > feature, just a shortcut. I hope it's me seeing it the wrong way. > > What happen if I rename the constructor parameters on a child class > constructor?

Re: [PHP-DEV] [RFC] Allow trailing comma in parameter lists

2020-03-26 Thread Lynn
On Thu, Mar 26, 2020 at 7:52 PM Nikita Popov wrote: > Hi internals, > > This has been declined in the past, but I just keep making this mistake, > and believe it deserves reconsideration... > > https://wiki.php.net/rfc/trailing_comma_in_parameter_list > > Nikita > This would be a great

Re: [PHP-DEV] [VOTE] Userspace operator overloading

2020-03-26 Thread Michał Brzuchalski
pon., 23 mar 2020 o 18:58 napisał(a): > Hi internals, > > I have opened voting on > https://wiki.php.net/rfc/userspace_operator_overloading, which allows > users > to overload operators in their own classes. > I got two comments, a little late but always better than even later. The first thing

Re: [PHP-DEV] [RFC] Constructor Property Promotion

2020-03-26 Thread Sebastian Bergmann
Am 26.03.2020 um 14:30 schrieb Nikita Popov: I would like to submit the following RFC for your consideration: https://wiki.php.net/rfc/constructor_promotion Looks good to me! Thanks. -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP-DEV] Re: [VOTE] Userspace operator overloading

2020-03-26 Thread jan.h.boehmer
On Thursday, March 26, 2020 3:50 AM Jakob Givoni wrote: > On Wed, Mar 25, 2020 at 6:28 AM Christoph M. Becker wrote: > >> It seems to me that the RFC is not sufficiently specific enough >> regarding the concatenation of instances of classes which implement >> __toString(). > > Exactly what I

Re: [PHP-DEV] [RFC] Constructor Property Promotion

2020-03-26 Thread Sara Golemon
On Thu, Mar 26, 2020 at 8:31 AM Nikita Popov wrote: > I would like to submit the following RFC for your consideration: > https://wiki.php.net/rfc/constructor_promotion > > This is based on one off the suggestions made in > https://externals.io/message/109220, and some existing discussion on the

Re: [PHP-DEV] [RFC] Constructor Property Promotion

2020-03-26 Thread Ben Ramsey
> On Mar 26, 2020, at 08:30, Nikita Popov wrote: > > Hi internals, > > I would like to submit the following RFC for your consideration: > https://wiki.php.net/rfc/constructor_promotion > > This is based on one off the suggestions made in > https://externals.io/message/109220, and some existing

Re: [PHP-DEV] [VOTE] Userspace operator overloading

2020-03-26 Thread Derick Rethans
On Thu, 26 Mar 2020, Derick Rethans wrote: > On Mon, 23 Mar 2020, jan.h.boeh...@gmx.de wrote: > > > I have opened voting on > > https://wiki.php.net/rfc/userspace_operator_overloading, which allows users > > to overload operators in their own classes. > > I've always been a strong proponent of

Re: [PHP-DEV] [RFC] Constructor Property Promotion

2020-03-26 Thread Chase Peeler
On Thu, Mar 26, 2020 at 9:33 AM Paul M. Jones wrote: > > > > On Mar 26, 2020, at 08:30, Nikita Popov wrote: > > > > Hi internals, > > > > I would like to submit the following RFC for your consideration: > > https://wiki.php.net/rfc/constructor_promotion > > Big fan. Thanks for this. > > I like

[PHP-DEV] semicolon terminator for switch cases

2020-03-26 Thread Ilija Tovilo
Hi internals Looking through the language grammer I discovered that switch cases can also be terminated with a `;` instead of a `:`. ``` switch ($i) { case 1; return 1; default; return 2; } ``` https://3v4l.org/o7nD8 This is in fact documented:

[PHP-DEV] [RFC] Allow trailing comma in parameter lists

2020-03-26 Thread Nikita Popov
Hi internals, This has been declined in the past, but I just keep making this mistake, and believe it deserves reconsideration... https://wiki.php.net/rfc/trailing_comma_in_parameter_list Nikita

Re: [PHP-DEV] [RFC] Constructor Property Promotion

2020-03-26 Thread David Rodrigues
Hello! With all respect, seems a bit confuses to me, without in fact offer a new feature, just a shortcut. I hope it's me seeing it the wrong way. What happen if I rename the constructor parameters on a child class constructor? Example (https://3v4l.org/VqQde): class A { public function

Re: [PHP-DEV] [RFC] Constructor Property Promotion

2020-03-26 Thread Michał Brzuchalski
czw., 26 mar 2020 o 14:31 Nikita Popov napisał(a): > Hi internals, > > I would like to submit the following RFC for your consideration: > https://wiki.php.net/rfc/constructor_promotion > > This is based on one off the suggestions made in > https://externals.io/message/109220, and some existing

Re: [PHP-DEV] Re: [VOTE] Userspace operator overloading

2020-03-26 Thread Christoph M. Becker
On 26.03.2020 at 18:18, Guilliam Xavier wrote: > On Thu, Mar 26, 2020 at 5:37 PM wrote: >> >> The overloaded concat operator has higher priority than the __toString() >> method. >> So if Class A overloades the concat operator, then calling $a . $b means >> ClassA::__concat($a, $b); (Note that

RE: [PHP-DEV] Re: [VOTE] Userspace operator overloading

2020-03-26 Thread jan.h.boehmer
On Thursday, March 26, 2020 6:19 PM Guilliam Xavier wrote: >> If the concat operator is not overloaded, the behavior is like now, and the >> objects are converted implicitly to strings (so $a . $b actually means >> (string) $a . (string) $b). >> Furthermore an notice is triggered, hinting the

Re: [PHP-DEV] semicolon terminator for switch cases

2020-03-26 Thread Claude Pache
> Le 26 mars 2020 à 21:49, Benoit SCHILDKNECHT a écrit : > > A semi-colon is terminal. Italways is. "You see this set of instructions? > Done.". But in this case, itis not. You see the problem? > No I don’t see the problem. Inside a switch construct, when you reach the end of an

Re: [PHP-DEV] [VOTE] Server-Side Request and Response Objects (v2)

2020-03-26 Thread Pedro Magalhães
Hi, To justify my "no" vote. I agree that it would be nice if PHP would provide these objects out of the box, but there are some inconsistencies in the object properties that made me oppose this. For instance, not all headers are treated equally, while some become properties of the request

Re: [PHP-DEV] semicolon terminator for switch cases

2020-03-26 Thread Stanislav Malyshev
Hi! > Maybe something to deprecate in PHP 8.0. > https://wiki.php.net/rfc/deprecations_php_8_0 Why? Whose life it'd make easier? -- Stas Malyshev smalys...@gmail.com -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] [RFC] [DISCUSSION] Type casting in array destructuring expressions

2020-03-26 Thread Enno Woortmann
$handle = fopen('test.csv', 'r'); while (($data = fgetcsv($handle)) !== false) { [int $id, string $data, int $year] = $data; // do something with the correctly typed variables } The code would trigger a fatal error when strict_types are enabled. With strict_types disabled it would

Re: [PHP-DEV] semicolon terminator for switch cases

2020-03-26 Thread David Rodrigues
I agree with Tovilo. It is weird and confusing. Actually I never know that it was possible. And the ";" sounds like "it ends here", while ":" counds like "it does it ->". For me, "case 1;" will sounds like "skip case 1". Atenciosamente, David Rodrigues Em qui., 26 de mar. de 2020 às 17:14,

Re: [PHP-DEV] [RFC] Allow trailing comma in parameter lists

2020-03-26 Thread Ben Ramsey
> On Mar 26, 2020, at 13:52, Nikita Popov wrote: > > Hi internals, > > This has been declined in the past, but I just keep making this mistake, > and believe it deserves reconsideration... > > https://wiki.php.net/rfc/trailing_comma_in_parameter_list > > Nikita Yes, please Cheers, Ben

Re: [PHP-DEV] semicolon terminator for switch cases

2020-03-26 Thread Stanislav Malyshev
Hi! On 3/26/20 1:26 PM, David Rodrigues wrote: > I agree with Tovilo. It is weird and confusing. Actually I never know > that it was possible. You seem to contradict yourself - if you never knew it was possible, how could you ever be confused by it? -- Stas Malyshev smalys...@gmail.com --

Re: [PHP-DEV] [VOTE] Userspace operator overloading

2020-03-26 Thread Derick Rethans
On Mon, 23 Mar 2020, jan.h.boeh...@gmx.de wrote: > Hi internals, > > I have opened voting on > https://wiki.php.net/rfc/userspace_operator_overloading, which allows users > to overload operators in their own classes. I've always been a strong proponent of operator overloading, but as PHP

[PHP-DEV] Re: semicolon terminator for switch cases

2020-03-26 Thread Andrea Faulds
Hi Ilija, Ilija Tovilo wrote: Looking through the language grammer I discovered that switch cases can also be terminated with a `;` instead of a `:`. ``` switch ($i) { case 1; return 1; default; return 2; } ``` https://3v4l.org/o7nD8 This is in fact documented:

Re: [PHP-DEV] semicolon terminator for switch cases

2020-03-26 Thread Claude Pache
> Le 26 mars 2020 à 19:37, Ilija Tovilo a écrit : > > What's the reasoning behind this? I find it weird an inconsistent. > This is a manifestly a leftover of an old syntax. Take a look at the PHP/FI 2 manual: Language constructs: https://www.php.net/manual/phpfi2.php#lang

Re: [PHP-DEV] semicolon terminator for switch cases

2020-03-26 Thread Christoph M. Becker
On 26.03.2020 at 23:04, Claude Pache wrote: >> Le 26 mars 2020 à 19:37, Ilija Tovilo a écrit : >> >> What's the reasoning behind this? I find it weird an inconsistent. > > This is a manifestly a leftover of an old syntax. Take a look at the PHP/FI 2 > manual: > > Language constructs: >

Re: [PHP-DEV] [VOTE] Userspace operator overloading

2020-03-26 Thread Sebastian Bergmann
Am 24.03.2020 um 11:06 schrieb Sebastian Bergmann: I voted "no" for the same reason. I changed my vote to "yes" because of Nikita's arguments. -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Class cast

2020-03-26 Thread Stanislav Malyshev
Hi! > Actually it is a simplest case, where only a single information was > considered. But you can expand it to something more complex, where > currently you will need create a static method to copy the data, which > is not a normalized way like cast could do. You can always use anonymous

[PHP-DEV] Fwd: Intended proposal for class visibility

2020-03-26 Thread Javier Spagnoletti
Hey there! I'm thrilled since this is my first proposal. I'd like to propose a new visibility schema for classes, based on a explicit group of namespaces allowed to use the class. The goal of this proposal is to provide a way to cover from a native language feature what currently is usually

Re: [PHP-DEV] [RFC] Constructor Property Promotion

2020-03-26 Thread Stanislav Malyshev
Hi! > I would like to submit the following RFC for your consideration: > https://wiki.php.net/rfc/constructor_promotion I like this shortcut. I am not sure though I understand why callable is not allowed? Can't it just create a non-typed property? -- Stas Malyshev smalys...@gmail.com -- PHP

[PHP-DEV] Re: Fwd: Intended proposal for class visibility

2020-03-26 Thread Mark Randall
On 26/03/2020 23:47, Javier Spagnoletti wrote: Hey there! I'm thrilled since this is my first proposal. This idea has been discussed a great many times over the years, and has generally always been rejected during discussion as something that does not add value to the language. If

Re: [PHP-DEV] [VOTE] Userspace operator overloading

2020-03-26 Thread Matthew Brown
I accept that it adds an extra level of understanding to the language – if you see function addAmounts($a, $b) { return $a + $b; } you no longer definitely know the answer will be numeric. However, I imagine that the sorts of people who will use this are _also_ the sorts of people who would add

Re: [PHP-DEV] semicolon terminator for switch cases

2020-03-26 Thread Benoit SCHILDKNECHT
Le Thu, 26 Mar 2020 21:28:38 +0100, Stanislav Malyshev a écrit: Hi! On 3/26/20 1:26 PM, David Rodrigues wrote: I agree with Tovilo. It is weird and confusing. Actually I never know that it was possible. You seem to contradict yourself - if you never knew it was possible, how could you ever

Re: [PHP-DEV] [RFC] Allow trailing comma in parameter lists

2020-03-26 Thread Larry Garfield
On Thu, Mar 26, 2020, at 1:52 PM, Nikita Popov wrote: > Hi internals, > > This has been declined in the past, but I just keep making this mistake, > and believe it deserves reconsideration... > > https://wiki.php.net/rfc/trailing_comma_in_parameter_list > > Nikita Endorse. I don't think

Re: [PHP-DEV] Removing warning for failed include

2020-03-26 Thread Claude Pache
> Le 26 mars 2020 à 03:08, Vasilii Shpilchin a > écrit : > > Hello everyone, > > PHP also can include from URL. In this case it makes sense to produce warning > and do not break execution. > I don’t think that it makes sense to include from URL, to begin with. IIRC, the

Re: [PHP-DEV] RFC Raised for str_starts_with and str_ends_with

2020-03-26 Thread Guilliam Xavier
On Thu, Mar 26, 2020 at 9:54 AM Nikita Popov wrote: > > On Thu, Mar 26, 2020 at 3:36 AM wrote: > > > Hi, > > > > Hope everyone is doing alright. I just raised a new RFC > > (https://wiki.php.net/rfc/add_str_starts_with_and_ends_with_functions , > > github patch:

Re: [PHP-DEV] [RFC] [DISCUSSION] Locale-independent float to string cast

2020-03-26 Thread Máté Kocsis
Hi Lynn, Thank you very much for the input! Then we could add a secondary vote to the RFC where an upgrade path was decided upon. The first such path is the one proposed by Christoph: Introduce a temporary ini setting with which a "debug" mode of float to string casting could be enabled. That

Re: [PHP-DEV] RFC Raised for str_starts_with and str_ends_with

2020-03-26 Thread Nikita Popov
On Thu, Mar 26, 2020 at 3:36 AM wrote: > Hi, > > Hope everyone is doing alright. I just raised a new RFC > (https://wiki.php.net/rfc/add_str_starts_with_and_ends_with_functions , > github patch: https://github.com/php/php-src/pull/5300) for adding > str_starts_with and str_ends_with to PHP. I

Re: [PHP-DEV] [RFC][DISCUSSION] throw expression

2020-03-26 Thread Nikita Popov
On Sun, Mar 22, 2020 at 5:17 PM Ilija Tovilo wrote: > Hi everybody! I hope you’re doing well. > > > > Due to the modest feedback I’d like to move the throw expression RFC to > “under discussion”. > > https://wiki.php.net/rfc/throw_expression > > > > In short, the RFC proposes to convert the

Re: [PHP-DEV] Removing warning for failed include

2020-03-26 Thread Nikita Popov
On Thu, Mar 26, 2020 at 1:11 AM Levi Morrison via internals < internals@lists.php.net> wrote: > It's bothered me for quite some time that a failed include emits a > warning. This is because it's by design that the author chose > `include` and not `require`. It's _expected_ that it may fail and

[PHP-DEV] PHP 8.0 Release Manager Selection

2020-03-26 Thread Gabriel Caruso
Hello there, I'd like to throw my name in the selection os RM for PHP 8 :) I've been contributing to PHP itself for a while, apart from many other contributions in the ecosystem. Best regards,

Re: [PHP-DEV] [RFC][DISCUSSION] throw expression

2020-03-26 Thread Ilija Tovilo
On 22.03.20, 18:17, "Dan Ackroyd" wrote: > $condition || throw new Exception('$condition must be truthy') > && $condition2 || throw new Exception('$condition2 must be truthy'); > > The "Deprecate left-associative ternary operator"* RFC made it so that > parentheses are required when ternary

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

2020-03-26 Thread Derick Rethans
Hi again, Just a reminder that if you're interested in being one of the PHP 8.0 release managers, then now is the time to step forwards. I'll be starting the selection procedure next week. cheers, Derick On Thu, 19 Mar 2020, Derick Rethans wrote: > Hi all! > > With the first alpha of 8.0

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

2020-03-26 Thread Jakub Zelenka
Hi, I think it might be worth to discuss if we want to go for PHP 8.0 at this time. I'd think that lots of businesses will prefer stability over new features and resolving BC breaks in the coming months. Also life of many devs might get impacted. I'm thinking that it would be good to at least

Re: [PHP-DEV] [RFC] Constructor Property Promotion

2020-03-26 Thread Paul M. Jones
> On Mar 26, 2020, at 08:30, Nikita Popov wrote: > > Hi internals, > > I would like to submit the following RFC for your consideration: > https://wiki.php.net/rfc/constructor_promotion Big fan. Thanks for this. -- Paul M. Jones pmjo...@pmjones.io http://paul-m-jones.com Modernizing

Re: [PHP-DEV] [RFC] [DISCUSSION] Type casting in array destructuring expressions

2020-03-26 Thread Enno Woortmann
Hi Levi, Am 25.03.2020 um 21:44 schrieb Levi Morrison: To me, this is almost a good idea. However, I would want regular type checking, not casts. Importantly, regular type checks would fit well on allowing array destructuring directly in function signatures, which would basically be a form of

Re: [PHP-DEV] [RFC] [DISCUSSION] Type casting in array destructuring expressions

2020-03-26 Thread Rowan Tommins
On Thu, 26 Mar 2020 at 12:39, Enno Woortmann wrote: > > $handle = fopen('test.csv', 'r'); > while (($data = fgetcsv($handle)) !== false) { > [int $id, string $data, int $year] = $data; > // do something with the correctly typed variables > } > > The code would trigger a fatal error

[PHP-DEV] [RFC] Constructor Property Promotion

2020-03-26 Thread Nikita Popov
Hi internals, I would like to submit the following RFC for your consideration: https://wiki.php.net/rfc/constructor_promotion This is based on one off the suggestions made in https://externals.io/message/109220, and some existing discussion on the topic can be found in that thread. The primary