Re: [PHP-DEV] [VOTE] Interface Default Methods

2023-07-13 Thread Brent Roose via internals
I want to pitch in, agreeing with Larry's message here. - There are multiple real life use cases where the combo trait/interface could be replaced by interface default methods - Several modern language apply the technique in one form or another, so it's already proven to be valuable - There

Re: [PHP-DEV] [RFC] Nullable intersection types

2021-07-29 Thread Brent Roose
Hi internals I wanted to apologise for the poor wording I used in my previous mail when I said "oversight". What I meant to say is what Nicolas described in his followup mail: feature freeze as a time to polish implementations. I personally consider nullability to be more of an implementation

Re: [PHP-DEV] [RFC] Nullable intersection types

2021-07-27 Thread Brent Roose
Hi all From a userland developer point of view: - PHP 7.0 types were a pain because of non-nullable types, the feature only became really useful as of PHP 7.1 - I share many people's opinion that this falls in the category of oversight - I think (A)|null is the only sensible way to go

Re: [PHP-DEV] Readonly properties and interfaces

2021-07-08 Thread Brent Roose
> On 7 Jul 2021, at 23:16, Larry Garfield wrote: > > On Wed, Jul 7, 2021, at 7:32 AM, Brent Roose wrote: >> Hi internals >> >> With the readonly properties RFC almost certainly accepted, I'd like to >> discuss an idea that's slightly related to them. >>

[PHP-DEV] Readonly properties and interfaces

2021-07-07 Thread Brent Roose
Hi internals With the readonly properties RFC almost certainly accepted, I'd like to discuss an idea that's slightly related to them. One of the problems that readonly properties solve is that they reduce the overhead of writing getters and setters. This is especially noticeable in objects

Re: [PHP-DEV] [RFC] noreturn type

2021-03-11 Thread Brent Roose
Hi Peter and internals > On 11 Mar 2021, at 07:51, Peter Stalman wrote: > > On Wed., Mar. 10, 2021, 11:22 Matthew Brown, > wrote: > >> If a significant number agree I can add a secondary vote on noreturn vs >> never, but never introduces more of a BC risk. >> > > Hi Matt, > > I like this

[PHP-DEV] Changes to finfo and imap functions

2021-02-10 Thread Brent Roose
Hi internals The chagelog for PHP 8.1 lists the two following changes: - Fileinfo: . The fileinfo functions now accept and return, respectively, finfo objects instead of resources. - IMAP: . The IMAP functions now accept and return, respectively, IMAPConnection objects instead of

Re: [PHP-DEV] Inheritance Cache

2021-02-08 Thread Brent Roose
Hey Dmitry Out of curiousity: how does this compare to preloading? From what I understand preloading also links classes, which was one of the most important differences between preloading files and simply storing them in opcache. Does this change mean that preloading becomes much less relevant

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

2021-01-29 Thread Brent Roose
: "will this method accept this value?" Is that in line with your view on `acceptsValue`? Kind regards Brent > On 29 Jan 2021, at 10:33, Nikita Popov wrote: > > On Fri, Jan 29, 2021 at 9:15 AM Brent Roose <mailto:bre...@stitcher.io>> wrote: > Hi Internals > &

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

2021-01-29 Thread Brent Roose
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 \ReflectionNamedType[] $types */ $types = match

Re: [PHP-DEV] #[Deprecated] Attribute

2021-01-13 Thread Brent Roose
Hi Sara > On 22 Dec 2020, at 19:54, Sara Golemon wrote: > > On Tue, Dec 22, 2020 at 12:35 PM Nicolas Grekas < > nicolas.grekas+...@gmail.com> wrote: > >> It would be great to allow adding this attribute on classes. What about >> allowing it right now and not bind it to any runtime side-effect?

Re: [PHP-DEV] [RFC] Enumerations

2020-12-07 Thread Brent Roose
Hi Larry and Ilja It's great to see you're looking into enums, thanks! I have a few considerations from a userland point of view. I've been maintaining a userland enum implementation for a while now [1] so I think I share a thing or two about my experience. - Scalar enums are spot on, exactly

Re: [PHP-DEV] PHP 8 release announcement page on php.net

2020-10-14 Thread Brent Roose
Hi internals Regarding the matter of a sandbox, one of my colleagues open sourced a Laravel sandbox that runs straight in the browser and uses docker containers, with a little work you can extract away the Laravel part and have it run plain PHP. Here's the source:

Re: [PHP-DEV] RFC: Support for multi-line arrow functions

2020-10-06 Thread Brent Roose
Hi internals The reason multi-line short closures are so valued by userland devs is because they are shorter to write and prettier to read. While some of us might not agree on the definition of "prettier to read", it was one of the key arguments for adding short closures in the first place: >

Re: [PHP-DEV] Attributes and strict types

2020-09-22 Thread Brent Roose
Hi Nikita From a userland point of view, I'd indeed expect this example to use strict_types, because it's declared in UseOfMyAttribute.php. Is this something that can be changed still? Kind regards Brent > On 22 Sep 2020, at 14:58, Nikita Popov wrote: > > Hi internals, > > I would like to

Re: [PHP-DEV] The case for transpiled generics

2020-09-17 Thread Brent Roose
class) > : array { >$new = []; >foreach ($arr as $a) { >if ($a instanceof $t_class) { >$new[] = $a; >} >} > } > ``` > > The implementation would also need a way of denoting covariant (pretty > common) and contravariant (very rare) generic parameters,

Re: [PHP-DEV] The case for transpiled generics

2020-09-17 Thread Brent Roose
Hi Ilija > On 17 Sep 2020, at 19:01, Ilija Tovilo wrote: > > Hi Brent > >> Today I'd like to hear your thoughts on what might be a controversial topic, >> though I think it's worth having this discussion. I want to make the case >> for adding generic syntax, without actually enforing any

Re: [PHP-DEV] The case for transpiled generics

2020-09-17 Thread Brent Roose
Hi Matthew and Larry > On 17 Sep 2020, at 18:21, Larry Garfield wrote: > > On Thu, Sep 17, 2020, at 10:21 AM, Matthew Brown wrote: >> Quick thing before I get into my own reaction: >> >> Transpiling is normally thought of as the process of converting one >> language into another. Tools like

Re: [PHP-DEV] The case for transpiled generics

2020-09-17 Thread Brent Roose
Hi George Thanks for the reply! > On 17 Sep 2020, at 14:34, G. P. B. wrote: > > Hello Brent, > > I'm going to make the argument I've already done on Reddit once [1], IMHO > TypeScript is just a nicer pipeline for a preprocessor and a static > analyser and not a language per say. > > Let me

[PHP-DEV] The case for transpiled generics

2020-09-17 Thread Brent Roose
Hello internals Today I'd like to hear your thoughts on what might be a controversial topic, though I think it's worth having this discussion. I want to make the case for adding generic syntax, without actually enforing any additional type checks at runtime. Please hear me out. We've been

Re: [PHP-DEV] PHP 8.0 branch cut

2020-09-15 Thread Brent Roose
Hey Dmitiry Speaking of the JIT. I remember berblei mentioning that the JIT configuration options were going to change prior to the final 8 release (https://www.reddit.com/r/PHP/comments/hjxlh9/jit_benchmarks_on_reallife_web_applications/fwuje8g/

Re: [PHP-DEV] Draft RFC: foreach iteration of keys without values

2020-09-03 Thread Brent Roose
Hi all I want to point out the use-case when you're using CS tools, static analysers and IDEs: they report unused variables as errors. There are ways around those errors, but it's more convenient if there's language support. I'd say that conceptually it's also more correct: if you're not using

Re: [PHP-DEV] Community vote on RFCs

2020-08-21 Thread Brent Roose
Hi Kalle, all > Anyone who is not actively involved with the PHP project, is not > someone I can feel safe with granting the right to vote. Just want to point out that there are lots of people eligable to vote who are not actively involved with PHP development at the moment. There has even

Re: [PHP-DEV] The @@ is terrible, are we sure we're OK with it?

2020-07-22 Thread Brent Roose
Doesn't it make the most sense to re-vote the syntax? I'd consider the previous vote to be invalid given the parsing issues that weren't listed in the RFC. A re-vote seems the most fair: if the majority still prefers @@, then so be it. Otherwise the syntax changes once again, before

Re: [PHP-DEV] Changing default assertion mode to throw exceptions

2020-07-22 Thread Brent Roose
Hi Levi I personally almost never use assert, and actually assumed it would throw an error, so this sounds like a good change! Have you done research on how this would affect the top-1000-ish popular packages like Nikita does? Kind regards Brent > On 20 Jul 2020, at 15:48, Levi Morrison via

Re: [PHP-DEV] [RFC] Saner string to number comparisons

2020-07-16 Thread Brent Roose
, at least not on modern-day projects. Kind regards Brent > On 15 Jul 2020, at 11:10, Nikita Popov wrote: > > On Wed, Jul 15, 2020 at 10:56 AM Brent Roose <mailto:bre...@stitcher.io>> wrote: > >> Hi Nikita >> >> Yes that would be nice, if it's not too muc

Re: [PHP-DEV] [RFC] Saner string to number comparisons

2020-07-15 Thread Brent Roose
Hi Nikita Yes that would be nice, if it's not too much of a hassle. I'm only able to test this in one or two large Laravel projects, so it would still be a limited test. Kind regards Brent > On 15 Jul 2020, at 10:53, Nikita Popov wrote: > > On Wed, Jul 15, 2020 at 10:49 AM Br

Re: [PHP-DEV] [RFC] Saner string to number comparisons

2020-07-15 Thread Brent Roose
Hi Nikita Is the ini setting available in current 7.4 builds? Is it documented somewhere? I'd like to test this change in some of our projects. Kind regards Brent > On 15 Jul 2020, at 10:28, Nikita Popov wrote: > > On Tue, Jul 14, 2020 at 11:47 PM Björn Larsson

Re: [PHP-DEV] [RFC] Treat namespaced names as single token, relax reserved keyword restrictions

2020-07-14 Thread Brent Roose
Hi Nikita What happens to the attributes syntax if this RFC doesn't pass? Furthermore, I think voting against this RFC to prevent the @@ syntax from happening is an abuse of the system. If there are problems with the attribute syntax, than the vote results on that one should be called void and

Re: [PHP-DEV] Typed array properties V2

2020-01-17 Thread Brent Roose
Hello all It's a much-requested feature for years and years. My first thought was "we need generics, not this" but than I took 5 minutes to actually think about it. While the same, and much more, can be achieved with generics, it's a difficult feature to implement. There have been several RFCs

Re: [PHP-DEV] Re: VCS Account Request: nicolasgrekas

2020-01-14 Thread Brent Roose
Hi Peter Isn't it strange that someone like Nicolas doesn't get a vote? Symfony has such a large impact on the PHP community, and Nicolas has such a large impact on its development. Meanwhile people who contribute to the PHP docs, sometimes completely estranged from modern day-to-day PHP

[PHP-DEV] --with-libxml-dir and libxml headers on MacOS

2019-11-21 Thread Brent Roose
Hello internals The upgrading guide lists that the option --with-libxml-dir is removed in PHP 7.4 (https://github.com/php/php-src/blob/PHP-7.4/UPGRADING#L763 ). Unfortunately on MacOS, header files are not stored in the usual

Re: [PHP-DEV] [VOTE] Object Initializer

2019-10-28 Thread Brent Roose
Hi Michał I can't help but wonder: why did you start the vote to begin with? It seemed to me that, based on the discussion feedback, it would never pass in its current form. Kind regards Brent > On 24 Oct 2019, at 09:41, Michał Brzuchalski > wrote: > > Hi all, > > I've closed the vote.