Re: [PHP-DEV] Re: Bundled Extension namespace(s)

2021-07-12 Thread Pierre R.
Le 12 juillet 2021 13:39:50 GMT+02:00, "Christoph M. Becker" a écrit : >On 12.07.2021 at 13:33, Pierre Joye wrote: > >> I would go with Gd, double uppercase is "harder" to type :) > >+1. That also matches GdImage and GdFont. > >Christoph > >-- >PHP Internals - PHP Runtime Development Mailing

Re: [PHP-DEV] Re: Proposal: namespace the SPL

2021-02-13 Thread Pierre R.
Le 13/02/2021 à 18:01, Levi Morrison via internals a écrit : You make some good points, Pierre. Here are my main rebuttals: 1. "Spl" is already the effective namespace for the SPL because that's the prefix used by SplFixedArray, SplQueue, spl_classes, and so on. Its namespace has already been

Re: [PHP-DEV] Analysis of property visibility, immutability, and cloning proposals

2021-02-03 Thread Pierre R.
Le 03/02/2021 à 15:14, Nikita Popov a écrit : I've written up an initial draft for property accessors at https://wiki.php.net/rfc/property_accessors, but once again I get the distinct impression that this is adding a lot of language complexity, that is possibly not justified (and it will be more

Re: [PHP-DEV] [DISCUSSION] ReflectionType::accepts

2021-01-29 Thread Pierre R.
Le 29/01/2021 à 09:14, Brent Roose a écrit : Hi Internals Since the addition of union types, it has become a little more cumbersome to determine whether a given parameter type accepts specific input. Personally I've been reusing this code blob in several places because of it: ``` /** @var \Re

Re: [PHP-DEV] Proposal: short_var_export($value, bool $return=false, int $flags=0)

2021-01-19 Thread Pierre R.
Le 19/01/2021 à 16:12, tyson andre a écrit : It seems inconsistent and prone to bugs when refactoring (e.g. converting to string and not using the result) to have two functions named var_export where one prints by default and the other doesn't, but otherwise . Changing to a different name entir

Re: [PHP-DEV] "TryX" idom for Enumerations

2021-01-15 Thread Pierre R.
Le 10/01/2021 à 22:27, Larry Garfield a écrit : This is a little tangent from the Enums RFC, but I want to flag it because it it's the sort of in-passing decision that could have far-reaching implications, so shouldn't be done implicitly. At the moment, the Enum RFC for scalar enums includes t

Re: [PHP-DEV] [RFC] Allow object keys in arrays

2021-01-13 Thread Pierre R.
Le 13/01/2021 à 10:08, Rowan Tommins a écrit : On 12/01/2021 16:51, Marco Pivetta wrote: Whether the problem can be mitigated is what should be discussed, but the problem is objectively there. Hi all, Like others, I like the *idea* of object keys, but worry about its practical impact. A

Re: [PHP-DEV] [RFC] Allow object keys in arrays

2021-01-12 Thread Pierre R.
Le 12/01/2021 à 17:35, Ilija Tovilo a écrit : Hi Marco On Tue, Jan 12, 2021 at 5:19 PM Marco Pivetta wrote: On Mon, Jan 11, 2021, 15:29 Nikita Popov wrote: Hi internals, I would like to present a draft RFC for allowing object keys in arrays: https://wiki.php.net/rfc/object_keys_in_arrays

Re: [PHP-DEV] [RFC] Enumerations, Round 2

2021-01-04 Thread Pierre R.
Le 04/01/2021 à 16:12, Markus Fischer a écrit : I can't say whether just `: string` is too much, but in general I like it. I can follow the reasoning having no value by default and opt this in. The opt-in you suggested is very low-overhead (albeit a bit subtle, but maybe someone has a smart

Re: [PHP-DEV] [RFC] Enumerations

2020-12-08 Thread Pierre R.
Le 08/12/2020 à 18:40, Larry Garfield a écrit : On Sat, Dec 5, 2020, at 2:26 PM, Larry Garfield wrote: On Fri, Dec 4, 2020, at 5:24 PM, Larry Garfield wrote: Greetings, denizens of Internals! Ilija Tovilo and I have been working for the last few months on adding support for enumerations and al

Re: [PHP-DEV] [RFC] Enumerations

2020-12-07 Thread Pierre R.
Le 07/12/2020 à 16:26, Larry Garfield a écrit : On Mon, Dec 7, 2020, at 2:46 AM, Michał Marcin Brzuchalski wrote: Thanks for taking the topic. I love it. Regarding the `::cases()` method on UnitEnum I guess it'd be more natural to cast enum into an array like: (array) Suit; but I realize it'

Re: [PHP-DEV] [RFC] Enumerations

2020-12-07 Thread Pierre R.
Le 07/12/2020 à 02:00, Paul Crovella a écrit : On Sun, Dec 6, 2020 at 7:12 AM Rowan Tommins wrote: Longer term plans are irrelevant except to avoid inadvertently shutting the door on something. This RFC is up for discussion, and will be up for voting, in isolation. It has to be able to stand on

Re: [PHP-DEV] [RFC] Enumerations

2020-12-05 Thread Pierre R.
Le 05/12/2020 à 15:42, Larry Garfield a écrit : On Sat, Dec 5, 2020, at 3:26 AM, Pierre R. wrote: Another question, about match() behavior: > This usage requires no modification of |match|. It is a natural implication of the current functionality. May be this could be the time to hav

Re: [PHP-DEV] [RFC] Enumerations

2020-12-05 Thread Pierre R.
Le 05/12/2020 à 12:14, Markus Fischer a écrit : Hi, On 05.12.20 10:22, Pierre R. wrote: I think that ::cases() should always return an array/iterable without keys, and let userland write their own code to create hashmaps with those when they need it. I think that having one case (non

Re: [PHP-DEV] [RFC] Enumerations

2020-12-05 Thread Pierre R.
Le 05/12/2020 à 00:24, Larry Garfield a écrit : Greetings, denizens of Internals! Ilija Tovilo and I have been working for the last few months on adding support for enumerations and algebraic data types to PHP. This is a not-small task, so we've broken it up into several stages. The first st

Re: [PHP-DEV] [RFC] Enumerations

2020-12-05 Thread Pierre R.
Le 05/12/2020 à 00:24, Larry Garfield a écrit : Greetings, denizens of Internals! Ilija Tovilo and I have been working for the last few months on adding support for enumerations and algebraic data types to PHP. This is a not-small task, so we've broken it up into several stages. The first st

Re: [PHP-DEV] Traits "implements" support

2020-11-30 Thread Pierre R.
Le 30/11/2020 à 16:19, Nikita Popov a écrit : Common misconception: It's not possible to rename methods of traits, you can only create aliases. That said, there's still an issue in that you might resolve a conflict in favor of an identically named method that uses a different signature. Note tha

Re: [PHP-DEV] Traits "implements" support

2020-11-26 Thread Pierre R.
Le 26/11/2020 à 17:50, David Rodrigues a écrit : Hello! Now with PHP 8, traits supports abstract functions that should be implemented by the class that uses this trait. So is it now possible that traits could have support to implements too? So when class uses this trait, it will be an implement

Re: [PHP-DEV] Method parameter promotion support

2020-11-26 Thread Pierre R.
Le 26/11/2020 à 17:30, David Rodrigues a écrit : Hello! It is just an idea to discuss. PHP 8 now supports parameter promotion via constructor. Could this idea also work for common methods? public function setAge(private int $age) {} === private int $age; public function setAge(int $age) { $this