Re: [PHP-DEV] [RFC] Asymmetric Visibility, v2

2024-06-03 Thread Alexandru Pătrănescu
On Fri, May 31, 2024 at 7:13 PM Larry Garfield wrote: > > So we feel the best way forward is to make the following changes: > > * private(set) implicitly means "final". (You can declare it explicitly > if you want, but it isn't necessary.) > * Make readonly incompatible with aviz again. > >

Re: [PHP-DEV] [RFC] Asymmetric Visibility, v2

2024-05-31 Thread Alexandru Pătrănescu
On Fri, May 31, 2024 at 10:30 AM Claude Pache wrote: > > > Le 30 mai 2024 à 17:07, Derick Rethans a écrit : > > > Now, if I define the property as public private(set) with similar > intentions, to make sure that there is no way for external scope or > extending classes scope to write to the

Re: [PHP-DEV] [RFC] Asymmetric Visibility, v2

2024-05-30 Thread Alexandru Pătrănescu
On Wed, May 29, 2024 at 10:18 PM Larry Garfield wrote: > As promised, Ilija and I offer this revised version of asymmetric > visibility. > > https://wiki.php.net/rfc/asymmetric-visibility-v2 > > Hey Larry, Ilija, I have one concern so far, and it's related to the inheritance section. If in a

Re: [PHP-DEV] Extract ArrayAccessRead from ArrayAccess

2024-05-27 Thread Alexandru Pătrănescu
On Mon, May 27, 2024 at 7:16 AM Valentin Udaltsov < udaltsov.valen...@gmail.com> wrote: > Hello, internals! > > Here's the idea: let's extract `ArrayAccess::offsetExists` and > `ArrayAccess::offsetGet` methods into a separate `ArrayAccessRead` > interface (name can be different) and allow read

Re: [PHP-DEV] [RFC] [Discussion] Support object type in BCMath

2024-04-30 Thread Alexandru Pătrănescu
On Tue, Apr 30, 2024 at 7:31 AM Saki Takamachi wrote: > Hi, > > If there is no further discussion, I will start voting tomorrow. (I > haven't decided on the time yet.) > https://wiki.php.net/rfc/support_object_type_in_bcmath > > > Just one small note from me, for mod operation, related to scale

Re: [PHP-DEV] [RFC] [Discussion] new MyClass()->method() without parentheses

2024-04-23 Thread Alexandru Pătrănescu
On Tue, Apr 23, 2024 at 3:31 PM Robert Landers wrote: > On Tue, Apr 23, 2024 at 11:10 AM Valentin Udaltsov > wrote: > > > > > > Does anyone have additional feedback? I'd like to start voting on > Thursday, April 25th. > > I've also added a section on other syntax ideas that have been expressed

Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-03-12 Thread Alexandru Pătrănescu
On Tue, Mar 12, 2024 at 4:36 PM Larry Garfield wrote: > On Tue, Mar 12, 2024, at 8:49 AM, Stephen Reay wrote: > > > Hi Larry > > > > Thanks again for both of your work on this, I'm really hopeful this > passes. > > > > Was there ever any further discussion/resolution/decision about the use > >

Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-02-27 Thread Alexandru Pătrănescu
On Wed, Feb 21, 2024, 20:58 Larry Garfield wrote: > Hello again, fine Internalians. > > After much on-again/off-again work, Ilija and I are back with a more > polished property access hooks/interface properties RFC. > I liked how the discussion and the RFC evolved so far and that we have less

Re: [PHP-DEV] int|float for sleep? sleep(0.1) => sleep 0.1 seconds

2024-02-17 Thread Alexandru Pătrănescu
On Fri, Feb 16, 2024 at 10:18 AM Hans Henrik Bergan wrote: > Can we make sleep accept int|float? > Made a PR: https://github.com/php/php-src/pull/13401 > > For years when I wanted to sleep for 0.1 seconds, it annoyed me that I > couldn't do > `sleep(0.1);` > instead I had to do > `usleep(figure

Re: [PHP-DEV] Re: Basic Type Alias

2023-10-28 Thread Alexandru Pătrănescu
Hey, So actually while reading this: On Fri, Oct 27, 2023 at 11:42 PM Oladoyinbo Vincent wrote: > And also, in order to group and namespace the Type Alias, i suggest we use > `typedef`, like i specify in my last message, it will be like this: > > File A.php: > > ```php > > namespace Package; >

Re: [PHP-DEV] RFC: Increasing the default BCrypt cost

2023-09-17 Thread Alexandru Pătrănescu
On Sun, Sep 10, 2023 at 7:06 PM Tim Düsterhus wrote: > Hi > > On 9/8/23 18:49, Alexandru Pătrănescu wrote: > > > > I think 12 looks reasonable. > > I've performed some tests myself on private hosted servers with > > newer hardware with good results f

Re: [PHP-DEV] Re: [RFC] [Discussion] DOM HTML5 parsing and serialization support

2023-09-17 Thread Alexandru Pătrănescu
On Sat, Sep 16, 2023, 02:17 Niels Dossche wrote: > > We'll add a common abstract base class DOM\Document (name taken from the > DOM spec & Javascript world). > DOM\Document contains the properties and abstract methods common to both > HTML and XML documents. > > Hi, Yes looks a lot better.

Re: [PHP-DEV] RFC: Increasing the default BCrypt cost

2023-09-08 Thread Alexandru Pătrănescu
On Thu, Sep 7, 2023 at 8:26 PM Tim Düsterhus wrote: > Hi > > in response to the recent "PASSWORD_DEFAULT value" thread [1], I've > created an RFC to discuss an increase of the default BCrypt costs for > `password_hash()` from the current value of 10. > > https://wiki.php.net/rfc/bcrypt_cost_2023

Re: [PHP-DEV] [RFC] [Discussion] Add 4 new rounding modes to round() function

2023-09-08 Thread Alexandru Pătrănescu
On Thu, Sep 7, 2023 at 11:10 PM Jordan LeDoux wrote: > > As someone who maintains a math library in PHP that has its own expanded > rounding implementation, I will politely disagree. Away from zero, towards > zero, towards positive infinity, and towards negative infinity are > completely and

Re: [PHP-DEV] [RFC] [Discussion] Add 4 new rounding modes to round() function

2023-09-03 Thread Alexandru Pătrănescu
Hi! On Sun, Sep 3, 2023 at 3:14 PM Tim Düsterhus wrote: > > The RFC mentions already has a section with regard to naming: > > > Why not the names PHP_ROUND_UP and PHP_ROUND_DOWN > > I generally agree with the argument in favor of the names you've chosen. > However they are inconsistent with

Re: [PHP-DEV] Replace ugly attribute token #[] to other

2023-08-23 Thread Alexandru Pătrănescu
On Wed, Aug 23, 2023 at 9:36 AM chopins xiao wrote: > I use @ instead of #[] as attribute token. attribute use whitespace marks > are closed. Of course you can start with @@ or #, other. > error control use @@ instead of @, add T_SILENCE token > > > > my implemented: >

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

2023-06-19 Thread Alexandru Pătrănescu
On Tue, Jun 20, 2023 at 7:30 AM Levi Morrison wrote: > On Sat, Jun 17, 2023 at 6:05 AM Alexandru Pătrănescu > wrote: > > > > 1. Do we want to allow also private methods in the interface so that it > > allows code reuse or better code organization in smaller methods?

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

2023-06-17 Thread Alexandru Pătrănescu
On Thu, Jun 15, 2023, 06:48 Levi Morrison via internals < internals@lists.php.net> wrote: > Hello, PHP Internals, > > I am moving my RFC for interface default methods to discussion: > https://wiki.php.net/rfc/interface-default-methods. > > Thank you for your time. I look forward to productive

Re: [PHP-DEV] RFC [Discussion]: Closure self-reference

2023-06-04 Thread Alexandru Pătrănescu
On Sat, Jun 3, 2023, 21:11 Dan Ackroyd wrote: > Hi internals, > > I'm now opening the discussion for the Closure self-reference RFC: > https://wiki.php.net/rfc/closure_self_reference > > This was previously discussed as a draft here: > https://externals.io/message/112216#112216 > > Thank-you to

Re: [PHP-DEV] [RFC] [Discussion] Clone with

2023-05-30 Thread Alexandru Pătrănescu
On Wed, May 31, 2023 at 2:53 AM Larry Garfield wrote: > On Tue, May 30, 2023, at 10:04 PM, Alexandru Pătrănescu wrote: > > On Tue, May 30, 2023, 19:39 Larry Garfield > wrote: > > > >> On Mon, May 29, 2023, at 11:22 PM, Máté Kocsis wrote: > >> > To be h

Re: [PHP-DEV] [RFC] [Discussion] Clone with

2023-05-30 Thread Alexandru Pătrănescu
On Tue, May 30, 2023, 19:39 Larry Garfield wrote: > On Mon, May 29, 2023, at 11:22 PM, Máté Kocsis wrote: > > To be honest, the current behavior seemed like the natural choice for > > me, and I didn't really consider to execute the __clone() method after > the > > clone assignments. > > Do you

Re: [PHP-DEV] [RFC] [Discussion] Clone with

2023-04-25 Thread Alexandru Pătrănescu
On Wed, Apr 26, 2023 at 3:25 AM Larry Garfield wrote: > On Tue, Apr 25, 2023, at 11:23 AM, Nicolas Grekas wrote: > > > What about using a real closure to define the scope we need for cloning? > > That closure would take the cloned instance as argument to allow > > manipulating it at will. > > I

Re: [PHP-DEV] [RFC] [Discussion] Clone with

2023-04-17 Thread Alexandru Pătrănescu
Hi Zoltán, On Mon, Apr 17, 2023 at 11:13 PM Zoltán Fekete wrote: > Hey, > > public function withStatus($code, $reasonPhrase = ''): Response > > { > > return clone $this { > > $this->statusCode = $code; > > $this->reasonPhrase = $reasonPhrase; > > }; > > } > > How to

Re: [PHP-DEV] [RFC] [Discussion] Clone with

2023-04-17 Thread Alexandru Pătrănescu
On Mon, Apr 17, 2023, 07:32 Máté Kocsis wrote: > finally I managed to create a working implementation for this feature which > would make it possible to properly modify readonly properties > while simplifying how we write "wither" methods: > https://wiki.php.net/rfc/clone_with Hey Máté, How

Re: [PHP-DEV] [RFC] Properties in interfaces

2023-03-30 Thread Alexandru Pătrănescu
On Thu, Mar 30, 2023 at 3:50 PM Larry Garfield wrote: > > This is a part of the "Property Hooks" RFC that Ilija and are working on. > It's not *quite* done yet, but it's mostly there. The draft is available > here: https://wiki.php.net/rfc/property-hooks > > Do you think we could have a smaller

Re: [PHP-DEV] [RFC][Vote announcement] Arbitrary static variable initializers

2023-03-15 Thread Alexandru Pătrănescu
On Wed, Mar 15, 2023, 14:02 Ilija Tovilo wrote: > Hi everybody > > It's been a while since I've announced this RFC. > https://wiki.php.net/rfc/arbitrary_static_variable_initializers > https://externals.io/message/118976 > > There haven't been many responses, so I'd like to put this to a vote >

Re: [PHP-DEV] Brainstorming idea: inline syntax for lexical (captured) variables

2023-03-14 Thread Alexandru Pătrănescu
On Wed, Mar 15, 2023 at 1:09 AM Rowan Tommins wrote: > On 14/03/2023 22:54, Larry Garfield wrote: > > Well, a large part of my resistance to automatic capture is that it > makes variable scope less visible at a glance. This avoids that by still > having a marker for "I am from another scope",

Re: [PHP-DEV] Class Re-implementation Mechanism

2023-02-21 Thread Alexandru Pătrănescu
On Tue, Feb 21, 2023 at 3:30 PM someniatko wrote: > > This sounds interesting but it breaks some expectations. > > > > Interesting because you can have any class act as an interface for other > classes with the interface being built up of any public properties or > method that exists on that

Re: [PHP-DEV] Class Re-implementation Mechanism

2023-02-21 Thread Alexandru Pătrănescu
Hi Someniatko, On Tue, Feb 21, 2023 at 1:52 PM someniatko wrote: > Hi again, internals > > My marathon of some crazy ideas continues :D, with less crazy one this > time. > > > ## Idea > > Allow "reimplementing" the non-static public API (that is public > properties and methods, excluding

Re: [PHP-DEV] RFC Proposal - Types for Inline Variables

2023-02-08 Thread Alexandru Pătrănescu
On Tue, Feb 7, 2023 at 10:21 PM Mark Baker wrote: > On 07/02/2023 20:53, Olle Härstedt wrote: > > No not really. I'd expect it behave similar to function argument > > type-hinting in PHP, that is, runtime checks, but where the notation > > can be used by external tools. > > The big difference is

Re: [PHP-DEV] RFC proposal: function array_filter_list() to avoid subtle bugs/workarounds

2023-02-01 Thread Alexandru Pătrănescu
On Wed, Feb 1, 2023, 19:59 Sergii Shymko wrote: > Hi Marco, > > > From: Marco Pivetta > Sent: Wednesday, February 1, 2023 9:25 AM > To: Sergii Shymko > Cc: internals@lists.php.net > Subject: Re: [PHP-DEV] RFC proposal: function array_filter_list() to avoid >

Re: [PHP-DEV] [RFC] [Discussion] Typed class constants

2023-01-31 Thread Alexandru Pătrănescu
On Tue, Jan 31, 2023 at 11:01 PM Máté Kocsis wrote: > Hi Everyone, > > A few years ago, Benas Seliuginas announced the "Typed constants" RFC ( > https://externals.io/message/110755) which apparently had a > positive reception overall. > Unfortunately, there were some issues with the

Re: [PHP-DEV] Re: DateTimeImmutable::modify() return type: doc or language bug?

2023-01-03 Thread Alexandru Pătrănescu
On Tue, Jan 3, 2023, 17:44 Christoph M. Becker wrote: > On 03.01.2023 at 10:48, Philip Hofstetter wrote: > > > `DateTimeImmutable::modify()` is documented as returning > > `DateTimeImmutable`, but it seems to actually be more specifically > > returning `static`: > > > > https://3v4l.org/j9ZSo >

Re: [PHP-DEV] [RFC] Asymmetric Visibility, with readonly

2022-11-30 Thread Alexandru Pătrănescu
On Wed, Nov 30, 2022, 05:25 Stephen Reay wrote: > > > > On 30 Nov 2022, at 08:27, Larry Garfield wrote: > > > > On Tue, Nov 29, 2022, at 5:46 PM, Claude Pache wrote: > > > >> In the RFC, section Permitted visibility > >> (https://wiki.php.net/rfc/asymmetric-visibility#permitted_visibility > >>

Re: [PHP-DEV] [RFC] [Discussion] Readonly class amendments

2022-11-15 Thread Alexandru Pătrănescu
Hi Mate, On Tue, Nov 15, 2022 at 8:30 AM Máté Kocsis wrote: > Hi Everyone, > > Following Nicolas' thread about "Issues with readonly classes" ( > https://externals.io/message/118554), we created an RFC to fix two issues > with the readonly behavior: https://wiki.php.net/rfc/readonly_amendments

Re: [PHP-DEV] RFC [Discussion]: Randomizer Additions

2022-10-13 Thread Alexandru Pătrănescu
On Thu, Oct 13, 2022, 22:37 Joshua Rüsweg via internals < internals@lists.php.net> wrote: > Hi > > Tim Düsterhus and I have created an RFC to add new methods that solve > commonly encountered use cases to \Random\Randomizer. Specifically > creating a random string consisting of specific bytes and

Re: [PHP-DEV] PHP 8.2 branch cut

2022-08-24 Thread Alexandru Pătrănescu
On Wed, Aug 24, 2022 at 1:15 AM Jakub Zelenka wrote: > > > > If it fixes a bug, it should be merged before RC 1, > > if it's a new feature or behavior change without a good reason, it should > > probably put off until PHP 8.3. > > > > As it was noted by Christoph, this is specifically spelled in

Re: [PHP-DEV] [RFC] Asymmetric visibility

2022-08-07 Thread Alexandru Pătrănescu
On Fri, Aug 5, 2022 at 8:09 PM Larry Garfield wrote: > Ilija Tovilo and I are happy to present the first new RFC for PHP 8.3: > Asymmetric Visibility. > > https://wiki.php.net/rfc/asymmetric-visibility > > Details are in the RFC, but it's largely a copy of Swift's support for the > same. > > --

Re: [PHP-DEV] [RFC][Under discussion] Fetch properties in const expressions

2022-06-22 Thread Alexandru Pătrănescu
On Fri, Jun 17, 2022 at 1:46 AM Ilija Tovilo wrote: > Even without __get the property of an object referenced in the LHS of > The engine evaluates the default property > values once for the entire class and then copies the result whenever a > new instance of that class gets created. That means

Re: [PHP-DEV] [RFC] [Under Discussion] Auto-implement Stringable for string backed enums

2022-06-22 Thread Alexandru Pătrănescu
On Wed, Jun 22, 2022 at 8:27 PM Larry Garfield wrote: > > So I am firmly against making it easier to (mis)use enums in a situation > where constants are already the superior solution by every metric. The > only argument I see is making case 1, transitioning from a string to an > enum for a

Re: [PHP-DEV] [RFC][Under discussion] Fetch properties in const expressions

2022-06-15 Thread Alexandru Pătrănescu
On Wed, Jun 15, 2022 at 6:59 PM Ilija Tovilo wrote: > Hi > > > Just a question. > > Would this also be allowed? > > > > https://3v4l.org/RGdIA > > > > > class A {public int $i = 42;} > > const BARE_CONSTANT = new A; > > class B { > > const ClassConstant = BARE_CONSTANT; > > } > > class C {

Re: [PHP-DEV] [RFC][Under discussion] Fetch properties in const expressions

2022-05-29 Thread Alexandru Pătrănescu
On Sat, May 28, 2022 at 12:44 PM Ilija Tovilo wrote: > Hi everyone > > I'd like to start a discussion on a simple RFC to allow fetching > properties in constant expressions. > https://wiki.php.net/rfc/fetch_property_in_const_expressions > > The RFC proposes adding support for fetching properties

Re: [PHP-DEV] Deprecated partially supported callables: should is_callable() throw a deprecation notice ?

2022-05-02 Thread Alexandru Pătrănescu
On Mon, May 2, 2022 at 2:15 PM Guilliam Xavier wrote: > On Wed, Mar 16, 2022 at 9:57 AM Christian Schneider > wrote: > > > > Am 16.03.2022 um 06:52 schrieb Juliette Reinders Folmer < > php-internals_nos...@adviesenzo.nl>: > > > I've just been looking in detail at the Partially Supported

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

Re: [PHP-DEV] Typed constants revisited

2022-03-30 Thread Alexandru Pătrănescu
Hey Mark, On Wed, Mar 30, 2022 at 4:01 PM Mark Niebergall wrote: > Alex, > > On Tue, Mar 29, 2022 at 10:35 PM Alexandru Pătrănescu > wrote: > >> Hey Mark, >> >> >> On Wed, Mar 30, 2022 at 6:03 AM Mark Niebergall >> wrote: >> >

Re: [PHP-DEV] Typed constants revisited

2022-03-29 Thread Alexandru Pătrănescu
Hey Mark, On Wed, Mar 30, 2022 at 6:03 AM Mark Niebergall wrote: > > I have updated the RFC https://wiki.php.net/rfc/typed_class_constants with > more details and examples from this thread, and updated the RFC status to > Under Discussion. Hopefully the updated RFC helps answer questions and >

Re: [PHP-DEV] Allowing NULL for some internal functions

2022-03-02 Thread Alexandru Pătrănescu
On Wed, Mar 2, 2022 at 4:17 PM Larry Garfield wrote: > On Wed, Mar 2, 2022, at 8:00 AM, Craig Francis wrote: > > On Wed, 2 Mar 2022 at 12:26, Dik Takken wrote: > > > >> So, to get this crystal clear, this is my understanding of what you are > >> proposing for passing null to a non-nullable

Re: [PHP-DEV] Allowing NULL for some internal functions

2022-02-21 Thread Alexandru Pătrănescu
On Mon, Feb 21, 2022 at 5:32 PM Craig Francis wrote: > On Mon, 21 Feb 2022 at 09:04, Christoph M. Becker > wrote: > > > That "inconsistency" had been introduced with PHP 7.0.0, i.e. right when > > scalar type declarations have been introduced. Passing a null to a > > non-nullable parameter of

Re: [PHP-DEV] RFC [Discussion]: Redacting parameters in back traces

2022-01-31 Thread Alexandru Pătrănescu
On Mon, Jan 31, 2022 at 11:55 AM Tim Düsterhus, WoltLab GmbH < duester...@woltlab.com> wrote: > Hi Internals! > > On 1/10/22 15:05, Tim Düsterhus, WoltLab GmbH wrote: > > https://wiki.php.net/rfc/redact_parameters_in_back_traces > At the end of last week I've updated the RFC a little based on the

Re: [PHP-DEV] Best way to monitor php-fpm container liveness on Kubernetes

2022-01-23 Thread Alexandru Pătrănescu
On Sat, Jan 22, 2022 at 10:00 PM Adam Hamsik wrote: > Hello, > > We are using PHP for our application backends, this works very well as we > have developed s imple way to clone them with minimal effort(they can be > very similar). For our orchestration we are using Kubernetes (>= 1.21). Our >

Re: [PHP-DEV] RFC [Discussion]: Redacting parameters in back traces

2022-01-10 Thread Alexandru Pătrănescu
On Mon, Jan 10, 2022 at 4:05 PM Tim Düsterhus, WoltLab GmbH < duester...@woltlab.com> wrote: > Hi Internals! > > this is a follow-up for my "Pre-RFC" email from last Friday, January, 7th. > > Christoph Becker granted me RFC editing permissions and I've now written > up our proposal as a proper

Re: [PHP-DEV] RFC: Trait expects interface

2022-01-06 Thread Alexandru Pătrănescu
On Thu, Jan 6, 2022 at 7:12 PM Rowan Tommins wrote: > > But some comments seem to be hinting at some *separate* advantage, to do > with "correct usage" of the trait, which I haven't grasped. It's possible > that the mention of static analysis relates to that in some way, and I'm > just

Re: [PHP-DEV] Re: [RFC] Deprecate dynamic properties

2021-11-16 Thread Alexandru Pătrănescu
On Tue, Nov 16, 2021 at 6:00 PM Andreas Heigl wrote: > Hey list. > Which performance improvement of the "original state" of the RFC? As > that was one of the questions that were not 100% answered: What are the > benefits for the language. And while those 8 bit that Nikita mentioned > in the

Re: [PHP-DEV] Re: [RFC] Deprecate dynamic properties

2021-11-15 Thread Alexandru Pătrănescu
On Mon, Nov 15, 2021 at 2:52 PM Andreas Heigl wrote: > > And as far as I can see from the PR associated with this RFC it will not > make life easier for the internals team. It is not like there will be > hundreds of lines code less to maintain. On the contrary. There is more > code and more

Re: [PHP-DEV] [RFC] Allow null as standalone type

2021-10-06 Thread Alexandru Pătrănescu
> On Tue, 5 Oct 2021 at 23:58, Alexandru Pătrănescu > wrote: > > > But there is one more small elephant in the RFC that I believe should be > > discussed. > > null|false type will not be a nullable named type but it will be an union > > between two named types. &g

Re: [PHP-DEV] [RFC] Allow null as standalone type

2021-10-05 Thread Alexandru Pătrănescu
On Sat, Oct 2, 2021 at 6:07 PM G. P. B. wrote: > Hello internals, > > I'm proposing a new RFC to make 'null' usable as a standalone type. > > RFC: https://wiki.php.net/rfc/null-standalone-type > GitHub PR: https://github.com/php/php-src/pull/7546 > > Best regards, > > George P. Banyard > Hey

Re: [PHP-DEV] Class static initialization block

2021-09-13 Thread Alexandru Pătrănescu
On Sun, Sep 12, 2021 at 2:28 AM David Rodrigues wrote: > Hello! > > I would like to suggest a feature I saw being implemented in the V8 9.4 > engine called "*class static initialization block*". > > https://v8.dev/blog/v8-release-94 > > In short, it is a method that is executed once when a class

Re: [PHP-DEV] 8.1 / Exception / Property Type / Backwards compatbility

2021-08-27 Thread Alexandru Pătrănescu
On Tue, Aug 10, 2021 at 12:55 PM Philip Hofstetter < phofstet...@sensational.ch> wrote: > Hello > > The following valid <= PHP 8.0 code that intends to make the $line property > public is a fatal error in 8.1 > > class FooException extends Exception { > public $line; > } > > However, the

Re: [PHP-DEV] Alternatives for encapsulation when using composition instead of inheritance

2021-08-26 Thread Alexandru Pătrănescu
On Fri, Aug 27, 2021 at 12:53 AM Rowan Tommins wrote: > On 26 August 2021 21:20:35 BST, "Olle Härstedt" > wrote: > >The Foo class has to decide who to give access to, otherwise it's the > >same as public access. > > > It does decide who has access: any class that declares it as "delegated". >

Re: [PHP-DEV] [RFC] Never For Argument Types

2021-08-15 Thread Alexandru Pătrănescu
On Sat, Aug 14, 2021, 01:27 Jordan LeDoux wrote: > Hey internals, > > I've been working on the draft for my operator overloading RFC, and in > doing so I encountered a separate change that I would like to see. > > That is, the use of `never` as an argument type for interfaces. Since > arguments

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

2021-08-14 Thread Alexandru Pătrănescu
On Sun, Aug 15, 2021, 04:33 Marco Pivetta wrote: > Heyo, just a follow-up. > > On Fri, 13 Aug 2021, 13:30 Marco Pivetta, wrote: > > > Hey Nicolas, > > > > I voted NO on this one. I'm not opposed to nullable intersection types, > > but not in PHP 8.1. > > > > Specifically, I'm waiting for the

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

2021-07-24 Thread Alexandru Pătrănescu
On Fri, Jul 23, 2021, 11:58 Nicolas Grekas wrote: > Hi everyone, > > as proposed by Nikita and Joe, I'm submitting this late RFC for your > consideration for inclusion in PHP 8.1. Intersection types as currently > accepted are not nullable. This RFC proposes to make them so. > > I wrote

Re: [PHP-DEV] Reply to an old thread

2021-07-21 Thread Alexandru Pătrănescu
On Thu, Jul 22, 2021, 04:18 Tobias Nyholm wrote: > Note to self: > Adding “Re: “ before the title does not work. > > =) > > https://news-web.php.net/php.internals/115546 < > https://news-web.php.net/php.internals/115546> > > // Tobias > > Hi Tobias, It depends on the tool used to read the

Re: [PHP-DEV] [Vote] Partial Function Application

2021-07-01 Thread Alexandru Pătrănescu
On Thu, Jul 1, 2021 at 3:05 PM Hamza Ahmad wrote: > Hi all, > > While I was reading through the discussion, I found a question related > to the conflict of constant names and functions names. In other words, > `strlen` can be both a constant name and a function name. > This was stated before

Re: [PHP-DEV] [RFC] New in initializers

2021-06-17 Thread Alexandru Pătrănescu
On Thu, Jun 17, 2021 at 12:53 PM Côme Chilliet < come.chill...@fusiondirectory.org> wrote: > Le Wed, 16 Jun 2021 10:16:37 +0200, > Nikita Popov a écrit : > > > 1. Eagerly evaluate initializers on declaration. This is what I tried in > an > > earlier revision of the RFC, and I don't think that

Re: [PHP-DEV] [RFC] New in initializers

2021-06-17 Thread Alexandru Pătrănescu
On Wed, Jun 16, 2021 at 11:17 AM Nikita Popov wrote: > > > The options where static properties and class constants are concerned are: > > 1. Eagerly evaluate initializers on declaration. This is what I tried in an > earlier revision of the RFC, and I don't think that approach works. It > breaks

Re: [PHP-DEV] Re: RFC: CachedIterable (rewindable, allows any key keys)

2021-06-09 Thread Alexandru Pătrănescu
On Wed, Jun 9, 2021 at 3:22 AM tyson andre wrote: > Hi internals, > > > I've created a new RFC https://wiki.php.net/rfc/cachediterable adding > CachedIterable, > > which eagerly evaluates any iterable and contains an immutable copy of > the keys and values of the iterable it was constructed from

Re: [PHP-DEV] [RFC] First-class callable syntax

2021-05-20 Thread Alexandru Pătrănescu
On Thu, May 20, 2021, 15:48 Nikita Popov wrote: > Hi internals, > > I'd like to present an RFC for a first-class callable syntax, which is > intended as a simpler alternative to the partial function application (PFA) > proposal: > > https://wiki.php.net/rfc/first_class_callable_syntax > > This

Re: [PHP-DEV] [RFC] [Draft] Add RNG extension and deprecate mt_srand()

2021-05-20 Thread Alexandru Pătrănescu
On Tue, May 18, 2021 at 7:19 PM Go Kudo wrote: > Hello internals. > > I have created a draft of the RFC. > > https://wiki.php.net/rfc/rng_extension > > This RFC is a proposal to implement the old object scope RNG in PHP. > > You can read about the discussion so far below. > > -

Re: [PHP-DEV] [RFC] Partial function application

2021-05-17 Thread Alexandru Pătrănescu
On Mon, May 17, 2021, 19:53 Guilliam Xavier wrote: > > > On Mon, May 17, 2021 at 5:47 PM Alexandru Pătrănescu > wrote: > >> >> On Mon, May 17, 2021 at 6:36 PM Guilliam Xavier < >> guilliam.xav...@gmail.com> wrote: >> >>> On Mon,

Re: [PHP-DEV] [RFC] Partial function application

2021-05-17 Thread Alexandru Pătrănescu
On Mon, May 17, 2021 at 6:36 PM Guilliam Xavier wrote: > On Mon, May 17, 2021 at 5:01 PM Levi Morrison > > wrote: > > > Joe Watkins has successfully worked out some bugs that also enable > > more powerful behavior. Thanks to Nikita and any others who worked > > with Joe on fixing these issues

Re: [PHP-DEV] [RFC] Partial function application

2021-05-17 Thread Alexandru Pătrănescu
On Mon, May 17, 2021 at 6:16 PM Mike Schinkel wrote: > > > > On May 17, 2021, at 10:50 AM, Guilliam Xavier > wrote: > > > > > > > > On Mon, May 17, 2021 at 6:58 AM Mike Schinkel > wrote: > > > > Casting is another interesting approach that does feel more consistent

Re: [PHP-DEV] Discussion: Object-scoped RNG

2021-05-12 Thread Alexandru Pătrănescu
On Wed, May 12, 2021 at 6:43 PM Christian Schneider wrote: > Am 11.05.2021 um 23:20 schrieb Larry Garfield : > > 3) Perhaps it should be named RandomSequence or similar? It's not truly > generating random numbers. It's generating a repeatable but difficult to > produce sequence off of a seed

Re: [PHP-DEV] [RFC] Partial function application

2021-05-11 Thread Alexandru Pătrănescu
Hi Larry, On Tue, May 11, 2021 at 8:55 PM Larry Garfield wrote: > > They currently do, since they work by creating a Closure-esque object > called Partial with an __invoke() method. > > --Larry Garfield > > 1. Would it be possible to mention the `Partial` class in the RFC? From what I

Re: [PHP-DEV] Re: [RFC] Autoloader Classmap

2021-04-06 Thread Alexandru Pătrănescu
On Tue, Apr 6, 2021 at 1:05 AM Mark Randall wrote: > On 15/03/2021 17:41, Mark Randall wrote: > > I would like to propose the addition of a new mechanism of autoloading > > classes - a classmap that will be consulted prior to checking the > > spl_autoload_register'd callbacks. > > > >

Re: [PHP-DEV] What should we do with utf8_encode and utf8_decode?

2021-03-22 Thread Alexandru Pătrănescu
On Mon, Mar 22, 2021 at 7:24 PM Alexandru Pătrănescu wrote: > > There could have been better ways to fix it. > json_encode / json_decode would have worked just the same. > > Nope, strings in a json object must be UTF-8. As Rowan mentioned, base64_encode would have worked. But

Re: [PHP-DEV] What should we do with utf8_encode and utf8_decode?

2021-03-22 Thread Alexandru Pătrănescu
On Mon, Mar 22, 2021 at 6:52 PM Aleksander Machniak wrote: > On 22.03.2021 16:41, Rowan Tommins wrote: > > That code will never do anything useful. > > I already proved it is useful, regardless of it's name/intention. > > This is old code, not even mine, so maybe when it's been written the PHP >

Re: [PHP-DEV] Re: [RFC] Static variables in inherited methods

2021-03-17 Thread Alexandru Pătrănescu
On Wed, Mar 17, 2021, 19:05 Nikita Popov wrote: > On Wed, Mar 17, 2021 at 5:48 PM Alexandru Pătrănescu > wrote: > >> >> On Wed, Mar 17, 2021 at 5:30 PM Nikita Popov >> wrote: >> >>> On Tue, Feb 23, 2021 at 3:01 PM Nikita Popov >>> wrote

Re: [PHP-DEV] Re: [RFC] Static variables in inherited methods

2021-03-17 Thread Alexandru Pătrănescu
On Wed, Mar 17, 2021 at 5:30 PM Nikita Popov wrote: > On Tue, Feb 23, 2021 at 3:01 PM Nikita Popov wrote: > > > Hi internals, > > > > While looking into various issues related to static variable handling, > > I've become increasingly convinced that our handling of static variables > in > >

Re: [PHP-DEV] [RFC Proposal] Allow methods to 'become' static

2021-03-15 Thread Alexandru Pătrănescu
On Sun, Mar 14, 2021 at 6:02 PM Gert de Pagter wrote: > Hey Internals, > > Recently i've been working on an older code base, where we have a lot > of classes with all > static methods. We've been moving to injecting the classes, and > calling the methods as if they > were not static. > > I

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

2021-03-10 Thread Alexandru Pătrănescu
Hi Rowan, On Wed, Mar 10, 2021, 20:55 Rowan Tommins wrote: > On 10/03/2021 18:06, Matthew Brown wrote: > > Ondřej Mirtes and I present an RFC for the noreturn type: > > https://wiki.php.net/rfc/noreturn_type > > > Thanks for the proposal, I can certainly think of uses for it. > The other

Re: [PHP-DEV] [RFC] New in initializers

2021-03-03 Thread Alexandru Pătrănescu
On Wed, Mar 3, 2021 at 5:49 PM Nikita Popov wrote: > On Wed, Mar 3, 2021 at 4:28 PM Alexandru Pătrănescu > wrote: > >> Hi, >> >> This looks very nice and I'm interested in further steps where not only >> new can be used :). >> >> The only thing I

Re: [PHP-DEV] [RFC] New in initializers

2021-03-03 Thread Alexandru Pătrănescu
Hi, This looks very nice and I'm interested in further steps where not only new can be used :). The only thing I think it would be good to improve is to have a deterministic order for running initialization. Yes, this can be done at a later point, I guess. But maybe there is already an order of

Re: [PHP-DEV] Replies on lists.php.net

2021-02-15 Thread Alexandru Pătrănescu
On Mon, Feb 15, 2021 at 2:20 PM Pierre wrote: > I think you always click "reply to all" instead of "reply to list" in your > mail client. > I'm interested in this topic as most email clients that I know don't have such an option like "reply to list". Instructions here clearly mention that

Re: [PHP-DEV] RFC: CachedIterable (rewindable, allows any key keys)

2021-02-12 Thread Alexandru Pătrănescu
On Thu, Feb 11, 2021 at 5:47 AM tyson andre wrote: > Hi internals, > > I've created a new RFC https://wiki.php.net/rfc/cachediterable adding > CachedIterable, > which eagerly evaluates any iterable and contains an immutable copy of the > keys and values of the iterable it was constructed from >

Re: [PHP-DEV] Proposal: Add ReverseArrayIterator and ForwardArrayIterator to SPL

2021-02-08 Thread Alexandru Pătrănescu
> > > I'll code this up soon unless someone objects. I'm very open to naming > suggestions for a better performing, simpler array iterator. > ListIterator or ArrayListIterator, as we are using the array as a list only, ordered, of key-value pairs...

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

2021-02-01 Thread Alexandru Pătrănescu
On Mon, Feb 1, 2021 at 9:30 PM Larry Garfield wrote: > On Mon, Feb 1, 2021, at 11:48 AM, Alexandru Pătrănescu wrote: > > > > > https://wiki.php.net/rfc/enumerations > > > > > > At this point, Ilija and I consider the RFC done and ready for a vote. > >

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

2021-02-01 Thread Alexandru Pătrănescu
On Fri, Jan 29, 2021 at 7:17 PM Larry Garfield wrote: > On Mon, Dec 28, 2020, at 2:21 PM, Larry Garfield wrote: > > Hello, Internalians! > > > > After considerable discussion and effort, Ilija and I are ready to > > offer you round 2 on enumerations. This is in the spirit of the > > previous

Re: [PHP-DEV] Re: [RFC] Object-scope RNG implementation

2021-01-27 Thread Alexandru Pătrănescu
On Tue, Jan 26, 2021 at 8:06 PM Go Kudo wrote: > RFCs have been reorganized and radically rewritten. > https://wiki.php.net/rfc/object_scope_prng > > The implementation is unchanged, but the background has been explained in > more detail and the execution speed has been re-verified with PHP

Re: [PHP-DEV] [RFC]: Change Default mysqli Error Mode

2021-01-25 Thread Alexandru Pătrănescu
On Mon, Jan 25, 2021 at 7:33 PM Christian Schneider wrote: > Am 25.01.2021 um 18:22 schrieb G. P. B. : > > And yes I'm basically advocating for people to add > mysqli_report(MYSQLI_REPORT_ERROR) (or even > mysqli_report(MYSQLI_REPORT_OFF) if they fancy) to their setup, I'm even > advocating for

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

2020-12-30 Thread Alexandru Pătrănescu
On Mon, Dec 28, 2020 at 10:22 PM Larry Garfield wrote: > > Hello, Internalians! > > After considerable discussion and effort, Ilija and I are ready to offer you round 2 on enumerations. This is in the spirit of the previous discussion, but based on that discussion a great deal has been reworked.

Re: [PHP-DEV] Array map with reset function

2020-08-27 Thread Alexandru Pătrănescu
On Wed, Aug 26, 2020 at 11:16 AM Rowan Tommins wrote: > > On Tue, 25 Aug 2020 at 20:08, Nikita Popov wrote: > > > On Tue, Aug 25, 2020 at 7:47 PM Michael Voříšek - ČVUT FEL < > > voris...@fel.cvut.cz> wrote: > > > > > The following code stopped working in PHP 8: > > > > > >

Re: [PHP-DEV] [RFC] Shorter Attribute Syntax Change RFC 0.2

2020-08-17 Thread Alexandru Pătrănescu
On Sun, Aug 16, 2020 at 12:36 PM Benjamin Eberlei wrote: > > We have updated the RFC with all (hopefully) of the feedback from this > discussion: > > https://wiki.php.net/rfc/shorter_attribute_syntax_change > > Most notable changes are: > - A new section with several subsections on the benefits

Re: [PHP-DEV] Re: [RFC] Better string interpolation

2020-08-16 Thread Alexandru Pătrănescu
On Sun, Aug 16, 2020, 20:45 Ilija Tovilo wrote: > Hi internals > > > I've been thinking about ways to improve string interpolation. > > Absolutely overwhelmed by the feedback (:P) I've decided to create a small > POC: > >

Re: [PHP-DEV] [VOTE] Remove inappropriate inheritance signature checks on private methods

2020-06-19 Thread Alexandru Pătrănescu
On Fri, Jun 19, 2020 at 12:17 PM Nikita Popov wrote: > > On Tue, Jun 16, 2020 at 11:19 AM Marco Pivetta wrote: > > > Hey Nikita, > > > > On Tue, Jun 16, 2020 at 11:05 AM Nikita Popov > > wrote: > > > >> On Mon, Jun 15, 2020 at 10:43 PM Pedro Magalhães wrote: > >> > >> > Hi internals, > >> > >

Re: [PHP-DEV] [RFC] [DISCUSSION] Make constructors and destructors return void

2020-06-16 Thread Alexandru Pătrănescu
Hi Benas, This looks good to me. Can you do a research on top 1k-2k most used composer packages and verify how small the BC break it is? Also, a suggestion on how to fix the BC issue if it exists could be mentioned I guess. Thank you, Aled On Wed, Jun 17, 2020, 02:11 Benas IML wrote: > Hey

Re: [PHP-DEV] [RFC] Shorter attribute syntax

2020-06-09 Thread Alexandru Pătrănescu
On Tue, Jun 9, 2020 at 6:57 PM Theodore Brown wrote: > Hi Benjamin, > > On Tue, June 9, 2020 at 6:55 AM Benjamin Eberlei wrote: > > > Larry's suggestion about `#[Attr]` makes an important argument about > > allowing to declare attributes in code in PHP 7 in a forward compatible > > way that has

Re: [PHP-DEV] [RFC] [Discussion] Remove inappropriate inheritance signature checks on private methods

2020-05-27 Thread Alexandru Pătrănescu
On Wed, May 27, 2020 at 2:08 AM Pedro Magalhães wrote: > On Tue, May 26, 2020 at 3:46 PM Marco Pivetta wrote: > > > Considering that, as far as I know, only the constructor remains > "special". > > > > Leaving the special case only for constructors instead of all magic methods > sounds better

Re: [PHP-DEV] [RFC] Attributes v2

2020-03-11 Thread Alexandru Pătrănescu
Hi Benjamin, Two small issues/questions: 1. It is not allowed to use the same attribute name more than once on the same declaration and a compile error is thrown when this detected. Is there any reason for this? IMO, the attribute can represents something that can have multiple options. Like an

Re: [PHP-DEV] [RFC] Increment/Decrement Fixes

2020-03-02 Thread Alexandru Pătrănescu
Hi Rowan, Thank you for the effort, very good unification of behavior across increment and decrement operations. I would say that all 3 points are most probably code issues and potential bugs. I agree with all of them. For point 3, the new behavior is an error. The problem will be caught earlier

  1   2   >