[PHP-DEV] New max_memory_limit INI setting

2025-04-14 Thread Ilija Tovilo
Hi everyone We've received a PR from Frederik Pytlick (@frederikpyt, thank you!) that introduces a new max_memory_limit INI setting. https://github.com/php/php-src/pull/18011 This setting declares an upper bound for memory_limit, which will prevent memory_limit from being set to a value higher t

Re: [PHP-DEV] [RFC] Pipe Operator (again)

2025-04-10 Thread Ilija Tovilo
Hi Larry Sorry again for the delay. On Fri, Apr 4, 2025 at 6:37 AM Larry Garfield wrote: > > * A new iterable API is absolutely a good thing and we should do it. > * That said, we *need* to split Sequence, Set, and Dictionary into separate > types. We are the only language I reviewed that didn

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

2025-04-05 Thread Ilija Tovilo
Hi Daniel On Mar 21 2025, at 11:17 pm, Daniel Scherzer wrote: > Contributing to php-src with features and bug fixes, > https://github.com/DanielEScherzer > Your account has been approved. You should have received an e-mail with a GitHub invitation. Derick also granted you the corresponding ka

Re: [PHP-DEV] Closure::getCurrent() for recursion

2025-04-05 Thread Ilija Tovilo
On Tue, Apr 1, 2025 at 12:40 PM Tim Düsterhus wrote: > > If you are at the point where you need mutually recursive closures, > perhaps you should just use named functions / an anonymous class. I > don't find it useful to “optimize DX” for that case, since > self-recursive Closures are already some

[PHP-DEV] Closure::getCurrent() for recursion

2025-04-04 Thread Ilija Tovilo
Hi everyone A few years ago, an RFC was proposed to introduce special syntax for self-referencing closures, mainly used for implementing recursion. https://wiki.php.net/rfc/closure_self_reference The proposed solution allows specifying a variable that will be assigned the closure object on funct

Re: [PHP-DEV] [RFC] Pipe Operator (again)

2025-04-03 Thread Ilija Tovilo
Hi Rowan On Thu, Apr 3, 2025 at 1:59 PM Rowan Tommins [IMSoP] wrote: > > At first, I thought Ilija's example looked pretty neat, but having > thought about it a bit more, I think the "first-arg" approach makes a > handful of cases nicer at the cost of a lot of magic, and making other > cases wors

Re: [PHP-DEV] [RFC] Pipe Operator (again)

2025-03-27 Thread Ilija Tovilo
Hi Larry Sorry for the late response. On Fri, Feb 7, 2025 at 5:58 AM Larry Garfield wrote: > > https://wiki.php.net/rfc/pipe-operator-v3 We have already discussed this topic extensively off-list, so let me bring the list up-to-date. The current pipes proposal is elegantly simple. This has many

Re: [PHP-DEV] RFC: short and inner classes

2025-03-15 Thread Ilija Tovilo
Hi Bob On Thu, Mar 13, 2025 at 11:36 PM Bob Weinand wrote: > > On 6.3.2025 23:20:37, Ilija Tovilo wrote: > > > I would also like to echo what has been said about the :: operator, > > which feels out of place. I understand that \ comes with additional > > autoloading c

Re: [PHP-DEV] Re: RFC: short and inner classes

2025-03-13 Thread Ilija Tovilo
Hi Rob On Thu, Mar 13, 2025 at 1:57 PM Rob Landers wrote: > > > the proposal is > > currently quite complex. > > Most of this is just describing how classes work already and going in-depth > on where there may be confusion -- there are no significant changes to how > classes actually work. The

Re: [PHP-DEV] Re: RFC: short and inner classes

2025-03-13 Thread Ilija Tovilo
Hi Rob On Thu, Mar 13, 2025 at 12:01 PM Tim Düsterhus wrote: > > Am 2025-03-12 11:10, schrieb Rob Landers: > > - Accessing inner classes is done via a new token: ":>" instead of > > "::". > > I don't particularly like that. It is “invented syntax” and I don't > think that inner classes are suffic

Re: [PHP-DEV] [RFC] [Discussion] Never parameters

2025-03-11 Thread Ilija Tovilo
Hi Daniel On Mon, Mar 10, 2025 at 8:06 PM Daniel Scherzer wrote: > > I'd like to start discussion on a new RFC about allowing `never` for > parameter types when declaring a method. > > * RFC: https://wiki.php.net/rfc/never-parameters-v2 > * Implementation: https://github.com/php/php-src/pull/180

Re: [PHP-DEV] OPcache should zero out cache slots?

2025-03-11 Thread Ilija Tovilo
Hi Rob On Mon, Mar 10, 2025 at 9:23 AM Rob Landers wrote: > > I’ve been trying to chase down a very subtle bug in 8.4 that only happens > when OPcache is enabled (I'm trying to create a reproducer to file an actual > bug). From what I can tell, OPcache doesn’t zero out cache slots, so > occasi

Re: [PHP-DEV] Manual unset and GC

2025-03-10 Thread Ilija Tovilo
Hi Vinicius On Mon, Mar 10, 2025 at 5:15 PM Vinicius Dias wrote: > > > TL;DR: Does setting a variable to `null` (or even `unset`ing it) have > > **any** effect if that's the last instruction of a function? As others have pointed out, it is _almost_ completely unobservable. There are two small d

Re: [PHP-DEV] RFC: short and inner classes

2025-03-06 Thread Ilija Tovilo
Hi Rob On Thu, Mar 6, 2025 at 12:14 AM Rob Landers wrote: > > I'd like to introduce my RFC for discussion: > https://wiki.php.net/rfc/short-and-inner-classes Thank you for your proposal. I'm very much against the idea of introducing yet another slightly shorter form to declare a class. In your

Re: [PHP-DEV] Consensus gathering: allowing unsetting of backed property hooks

2025-02-26 Thread Ilija Tovilo
On Wed, Feb 26, 2025 at 2:02 PM Rob Landers wrote: > > I do think it makes sense to have an unset hook though, so long as it is > thought out well. For example, would the unset hook be called automatically > during garbage collection? I would be very wary of adding more ways for destruction to

Re: [PHP-DEV] Introduction - Sam Lewis

2025-02-14 Thread Ilija Tovilo
Hi Sam On Sat, Feb 8, 2025 at 3:31 PM Sam Lewis wrote: > > I'm new to the PHP community and have enjoyed learning the language over the > past year or so. I saw someone in the Laravel community mention how they > wished PHP had built-in functions for converting temperatures between > Fahrenhei

Re: [PHP-DEV] [RFC] [Discussion] Optional interfaces

2025-02-11 Thread Ilija Tovilo
Hi Juris On Sun, Feb 9, 2025 at 10:16 PM Juris Evertovskis wrote: > > https://wiki.php.net/rfc/optional-interfaces Thanks for your efforts. I've reviewed the patch, it seems there are still a few issues and it would be great if we could solve them before this goes into voting. A few thoughts o

Re: [PHP-DEV] Short class syntax and inner classes

2025-02-07 Thread Ilija Tovilo
Hi there On Fri, Feb 7, 2025 at 4:07 PM Tim Düsterhus wrote: > > I believe Ilija has some proof-of-concept regarding file-private > classes, which would sidestep the above problem of disambiguating static > member access. Indeed. I shared a draft internally and responses were mixed. https://wik

Re: [PHP-DEV] Pattern matching details questions

2025-02-06 Thread Ilija Tovilo
On Thu, Feb 6, 2025 at 10:43 PM Christoph M. Becker wrote: > > On 06.02.2025 at 20:24, Larry Garfield wrote: > > > On Thu, Feb 6, 2025, at 3:05 AM, Valentin Udaltsov wrote: > > > >> Are there any plans to upgrade the parser to bypass these limitations? > >> I remember Nikita shared some thoughts o

Re: [PHP-DEV] RFC: Not Null Assertion Operator

2025-02-06 Thread Ilija Tovilo
Hi Mihail On Thu, Feb 6, 2025 at 1:51 PM Mihail Liahimov <91lia...@gmail.com> wrote: > > Examples of potentially using in PHP: > Without this operator we writing this code: > > $foo!->bar > $foo!->someProperty->method(); > $foo!->someProperty->anotherProperty!->method(); > > I think the postfix op

Re: [PHP-DEV] RFC: Not Null Assertion Operator

2025-02-05 Thread Ilija Tovilo
Hi Mihail Thanks for your proposal. On Wed, Feb 5, 2025 at 9:24 AM Mihail Liahimov <91lia...@gmail.com> wrote: > > Good afternoon. I would like to create an RFC on the implementation of the > NOT null assertion operator. Do you think it makes sense to create it? I was > able to implement the op

Re: [PHP-DEV] Re: Discussion: making continue and break into an expression

2025-02-02 Thread Ilija Tovilo
Hi Dmitrii On Sun, Feb 2, 2025 at 2:36 PM Dmitry Derepko wrote: > > I had similar idea to make `break`, `continue` and `return` be expressions > instead of statements to simplify almost the same cases as Robert described > above. > > Grammar corrections in the PR. https://github.com/php/php-src

Re: [PHP-DEV] Empty subject in match and switch constructions

2025-02-02 Thread Ilija Tovilo
.php.net/rfc/short-match https://externals.io/message/112496 > `when` construction is overwhelming, but some features are totally handy, > such as checking for class of the subject: > when (obj) { > is Class1 -> … > is Class2 -> … > else -> ... > } > > Which was

Re: [PHP-DEV] RFC Karma Request

2025-02-02 Thread Ilija Tovilo
On Sun, Feb 2, 2025 at 2:26 PM Tim Düsterhus wrote: > > `break` and `continue` should be bundled together, because they are so > similar. I'd say that a single RFC (and thus a single discussion for all > of them) is fine and that RFC can then contain two primary 2/3 majority > votes for "Should re

Re: [PHP-DEV] RFC Karma Request

2025-01-31 Thread Ilija Tovilo
Hi Dmitrii On Fri, Jan 31, 2025 at 3:10 PM Dmitry Derepko wrote: > > I’m looking for way to gain some Karma to create an RFC. > I’ve already made first implementation and shared it: > https://github.com/php/php-src/pull/17647 > > I can make 3 different RFC to discuss each change separately, let

Re: [PHP-DEV] Behaviour of ReflectionClass::getStaticPropertyValue() for uninitialized typed properties

2025-01-26 Thread Ilija Tovilo
Hi Niels On Sun, Jan 26, 2025 at 7:43 PM Niels Dossche wrote: > > I'm looking for feedback on a bugfix for > https://github.com/php/php-src/issues/12856. > Fix PR: https://github.com/php/php-src/pull/17590 > > So the alternative idea, the one implemented in my PR, would be this: > > - If the pro

Re: [PHP-DEV] [RFC] Static property asymmetric visibility

2025-01-07 Thread Ilija Tovilo
Hi Niels On Tue, Jan 7, 2025 at 7:37 PM Niels Dossche wrote: > > On 04/01/2025 00:14, Larry Garfield wrote: > >> > >> https://wiki.php.net/rfc/static-aviz > I'm not sure how I feel about this. > The current implementation actually uses a workaround because otherwise it > interferes with cache s

Re: [PHP-DEV] Re: Inaccurate documentation on return values from native functions

2024-12-02 Thread Ilija Tovilo
On Mon, Dec 2, 2024 at 1:31 PM Rowan Tommins [IMSoP] wrote: > > On 01/12/2024 03:41, mickmackusa wrote: > > I can appreciate that. Going forward, is there any benefit to preserving the > behavior of returning integers beyond -1, 0, and 1? > Should these topically related functions receive a new

Re: [PHP-DEV] [RFC] Data Classes

2024-11-23 Thread Ilija Tovilo
On Sat, Nov 23, 2024 at 11:10 PM Ilija Tovilo wrote: > > On Sat, Nov 23, 2024 at 2:12 PM Rob Landers wrote: > > > > Born from the Records RFC (https://wiki.php.net/rfc/records) discussion, I > > would like to introduce to you a competing RFC: Data Classes >

Re: [PHP-DEV] [RFC] Data Classes

2024-11-23 Thread Ilija Tovilo
Hi Rob On Sat, Nov 23, 2024 at 2:12 PM Rob Landers wrote: > > Born from the Records RFC (https://wiki.php.net/rfc/records) discussion, I > would like to introduce to you a competing RFC: Data Classes > (https://wiki.php.net/rfc/dataclass). As others have pointed out, your RFC is very similar t

[PHP-DEV] opcache_compile_file() declares top-level functions

2024-11-20 Thread Ilija Tovilo
Hi everyone We recently received a bug report regarding the behavior of opcache_compile_file() [1]. The documentation specifies: https://www.php.net/manual/en/function.opcache-compile-file.php > This function compiles a PHP script and adds it to the opcode cache without > executing it. This can

Re: [PHP-DEV] A new fuzz testing tool for PHP

2024-11-18 Thread Ilija Tovilo
Hi Yuancheng On Fri, Nov 15, 2024 at 2:21 PM Yuancheng Jiang <0599jian...@gmail.com> wrote: > > I have been submitting hundreds of bugs (see > https://github.com/php/php-src/issues/created_by/YuanchengJiang) during the > past months and I first thank all the developers who take time to fix these

Re: [PHP-DEV] RFC: Records

2024-11-16 Thread Ilija Tovilo
Hi Rob On Sun, Nov 17, 2024 at 12:15 AM Rob Landers wrote: > > Hello internals, > > I'm ready as I'm going to be to introduce to you: "Records" > https://wiki.php.net/rfc/records! Thanks for your proposal. I very much agree that value semantics are a highly desirable feature. I sent out my con

Re: [PHP-DEV] [RFC] Change behaviour of array sort functions to return a copy of the sorted array

2024-10-21 Thread Ilija Tovilo
Hi Gina On Mon, Oct 21, 2024 at 3:21 PM Gina P. Banyard wrote: > > On Sunday, 20 October 2024 at 18:42, Gina P. Banyard > wrote: > > > https://wiki.php.net/rfc/array-sort-return-array > > For an example, I'm going to pull out my solution to day 1 of the 2022 > advents of code: > > https://gith

Re: [PHP-DEV] [RFC] Change behaviour of array sort functions to return a copy of the sorted array

2024-10-20 Thread Ilija Tovilo
Hi Bilge On Sun, Oct 20, 2024 at 10:30 PM Bilge wrote: > > I fail to see the logic of present tense = mutate, past tense = copy. At > least there is a pattern to it, but I would have to look it up several times > before it sunk in since it is not intuitive at all. It's sorted, the adjective. A

Re: [PHP-DEV] [RFC] Change behaviour of array sort functions to return a copy of the sorted array

2024-10-20 Thread Ilija Tovilo
Hi Gina On Sun, Oct 20, 2024 at 7:43 PM Gina P. Banyard wrote: > > I would like to propose a short RFC to make the return value of the sort() > and similar functions more useful: > https://wiki.php.net/rfc/array-sort-return-array I think this adds two unnecessary sources of confusion: 1. What

Re: [PHP-DEV] Asymmetric visibility Reflection API problems

2024-10-04 Thread Ilija Tovilo
Hi Valentin Thank you for bringing up your concerns. On Thu, Oct 3, 2024 at 3:32 PM Valentin Udaltsov wrote: > > We are going to talk about the asymmetric visibility RFC [2] and the > new `ReflectionProperty::is(Private|Protected)Set()` > methods. Consider a class and reflected facts about it's

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

2024-09-26 Thread Ilija Tovilo
On Thu, Sep 26, 2024 at 1:45 PM Tim Düsterhus wrote: > > Am 2024-09-25 21:26, schrieb Ayesh Karunaratne: > > I see the account is already approved. > > Unless you did not yet accept the invitation to the GitHub organization, > it appears that you were not invited there yet. If that is the case, >

Re: [PHP-DEV] Which IDE do you recommend for php-src development?

2024-09-15 Thread Ilija Tovilo
Hi Carlos On Sat, Sep 14, 2024 at 11:44 PM Barel wrote: > > For C/C++ development I usually use CLion from Jetbrains but I tried to use > it with php-src and was unable to get it to work properly. CLion really > insists on using CMake and has only quite limited support for makefiles. > After t

Re: [PHP-DEV] json_encode() and Generators / RFC Karma

2024-08-30 Thread Ilija Tovilo
On Fri, Aug 30, 2024 at 12:19 PM Philip Hofstetter wrote: > > Username is pilif RFC karma was granted. Good luck with the RFC!

Re: [PHP-DEV] json_encode() and Generators / RFC Karma

2024-08-30 Thread Ilija Tovilo
Hi Philip On Fri, Aug 30, 2024 at 9:37 AM Philip Hofstetter wrote: > > If you think this is a worthwhile thing to do an RFC for, I would kindly ask > for somebody to grant me RFC karma, so I can start working on one. To grant you RFC karma, I need to know your wiki.php.net username. Ilija

Re: [PHP-DEV] [RFC] Default expression

2024-08-25 Thread Ilija Tovilo
Hi Rowan On Sun, Aug 25, 2024 at 6:06 PM Rowan Tommins [IMSoP] wrote: > > On 25/08/2024 16:29, Bilge wrote: > > You can write, `include(1 + 1);`, because `include()` accepts an > > expression. You will get: "Failed opening '2' for inclusion". Should > > we restrict that? No, because that's just h

Re: [PHP-DEV] [Concept] Flip relative function lookup order (global, then local)

2024-08-24 Thread Ilija Tovilo
Hi Stephen On Sat, Aug 24, 2024 at 1:54 PM Stephen Reay wrote: > > Thanks for clarifying. Out of curiosity, how much optimisation do you imagine > would be possible if the lookups were done the same was as classes (ie no > fallback, names must be local, qualified or imported with `use`)? I hav

Re: [PHP-DEV] [Concept] Flip relative function lookup order (global, then local)

2024-08-24 Thread Ilija Tovilo
Stephen On Sat, Aug 24, 2024 at 2:00 PM Stephen Reay wrote: > > When I said this thread reads like an April fools joke that wasn't a > challenge you know. We *just* had somebody temporarily banned for ad-hominem attacks like a week ago. Please familiarize yourself with the mailing list rules. T

Re: [PHP-DEV] [Concept] Flip relative function lookup order (global, then local)

2024-08-23 Thread Ilija Tovilo
On Fri, Aug 23, 2024 at 9:41 PM Rowan Tommins [IMSoP] wrote: > > On 23 August 2024 18:32:41 BST, Ilija Tovilo wrote: > >IMO, 1. is too drastic. As people have mentioned, there are tools to > >automate disambiguation. But unless we gain some other benefit from > >dropping

Re: [PHP-DEV] [Concept] Flip relative function lookup order (global, then local)

2024-08-23 Thread Ilija Tovilo
On Fri, Aug 23, 2024 at 8:19 PM John Coggeshall wrote: > > 1. People who don't think BC is a problem, and would like to drop > either the global or local lookup entirely, requiring disambiguation. > > There is also an option of swapping the priority, making local lookups > secondary to global loo

Re: [PHP-DEV] [Concept] Flip relative function lookup order (global, then local)

2024-08-23 Thread Ilija Tovilo
On Fri, Aug 23, 2024 at 8:11 PM Stephen Reay wrote: > > On 24 Aug 2024, at 00:32, Ilija Tovilo wrote: > > > I obviously also disagree with 3. as I wouldn't have sent this > > proposal otherwise. :) Performance improvements are hard to come by > > nowadays. I

Re: [PHP-DEV] [Concept] Flip relative function lookup order (global, then local)

2024-08-23 Thread Ilija Tovilo
On Fri, Aug 23, 2024 at 5:49 PM Rowan Tommins [IMSoP] wrote: > > Other proposals aim to shift that balance - leaving some inconsistency, but > less compatibility break. > > And most users don't object to using a leading backslash, they just (quite > reasonably) have no idea what impact it has on

Re: [PHP-DEV] [Concept] Flip relative function lookup order (global, then local)

2024-08-21 Thread Ilija Tovilo
Hi John On Wed, Aug 21, 2024 at 8:02 PM John Coggeshall wrote: > > This is an attack vector for every application and I would argue should be a > real concern for the vast majority of applications out there -- any which > rely on namespace-based frameworks and composer packages from untrustwor

Re: [PHP-DEV] [Concept] Flip relative function lookup order (global, then local)

2024-08-20 Thread Ilija Tovilo
Hi Levi On Tue, Aug 20, 2024 at 5:14 PM Levi Morrison wrote: > > I have long been in favor of a larger BC break with better language > consistency. Class lookup and function lookup with respect to > namespaces should be treated the same. The difficulty is getting a > majority of people to vote ye

Re: [PHP-DEV] Require C11 in PHP 8.4

2024-08-13 Thread Ilija Tovilo
Hi Levi On Tue, Aug 13, 2024 at 5:00 PM Levi Morrison wrote: > > On Tue, Aug 13, 2024 at 8:17 AM Ilija Tovilo wrote: > > > > Just to state it officially: You object to switching to C11 in 8.4? In > > that case, we'll have to postpone. > > I don't obje

Re: [PHP-DEV] Require C11 in PHP 8.4

2024-08-13 Thread Ilija Tovilo
Hi Levi On Mon, Aug 12, 2024 at 5:56 PM Levi Morrison wrote: > > Given the timetable, I wouldn't change the C std requirements for 8.4. Just to state it officially: You object to switching to C11 in 8.4? In that case, we'll have to postpone. > I would stop relying on the typedef and forward dec

Re: [PHP-DEV] [DISCUSSION] C++ Enhancements in Zend API

2024-08-12 Thread Ilija Tovilo
On Mon, Aug 12, 2024 at 9:00 PM Lanre wrote: > > I didn’t realize this was an open mic for Rust devs to flaunt their > ignorance, but since you’ve decided to chime in, let me spell it out for you. > Rust has absolutely nothing to do with this discussion, so try to stay on > topic. Nowhere did I

Re: [PHP-DEV] Require C11 in PHP 8.4

2024-08-11 Thread Ilija Tovilo
> Giovanni's remark that this would impact many people was challenged by > Jakub [1] which didn't get a response. I believe it's safe to assume > that this isn't the case. I somehow forgot to link this reference, sorry about that. [1] https://externals.io/message/124706#124717

Re: [PHP-DEV] Require C11 in PHP 8.4

2024-08-11 Thread Ilija Tovilo
Hi Christoph On Sat, Aug 10, 2024 at 2:19 PM Christoph M. Becker wrote: > > On 01.08.2024 at 23:57, Ilija Tovilo wrote: > > So skimming the whole discussion[1] it seems that most are generally > fine with bumping the requirements to C11, except for Giovanni Giacobbi > (whose

Re: [PHP-DEV] [RFC] Add Directive to Make All Namespaced Function Calls Global

2024-08-05 Thread Ilija Tovilo
On Mon, Aug 5, 2024 at 3:33 PM Nick Lockheart wrote: > > This is a different problem that could be solved by a sandbox API. Not sure which case we were talking about then. ClockMock is what I've been referencing all along. > > Well, ok. But then we're back to prefixing global calls, which > > de

Re: [PHP-DEV] [Concept] Flip relative function lookup order (global, then local)

2024-08-05 Thread Ilija Tovilo
On Mon, Aug 5, 2024 at 1:23 PM Derick Rethans wrote: > > On Fri, 2 Aug 2024, Ilija Tovilo wrote: > > > As for providing a migration path: One approach might be to introduce > > an INI setting that performs the function lookup in both local and > > global scope at run

Re: [PHP-DEV] [RFC] Add Directive to Make All Namespaced Function Calls Global

2024-08-05 Thread Ilija Tovilo
On Mon, Aug 5, 2024 at 2:27 PM Nick Lockheart wrote: > > > > I'm not sure your proposal solves the mocking problem. If the engine > > is to interpret all non-fq calls as global or local, how would a > > library include your file while switching this configuration, when it > > is implemented as som

Re: [PHP-DEV] [RFC] Add Directive to Make All Namespaced Function Calls Global

2024-08-05 Thread Ilija Tovilo
On Mon, Aug 5, 2024 at 10:22 AM Nick Lockheart wrote: > > > Sorry, my language was not precise enough. Your proposal suggests > > making unqualified calls global when the directive is present, > > whereas my proposal suggests keeping local scope as a fallback, hence > > the two not being compatibl

Re: [PHP-DEV] [RFC] Add Directive to Make All Namespaced Function Calls Global

2024-08-04 Thread Ilija Tovilo
On Sun, Aug 4, 2024 at 8:41 PM Nick Lockheart wrote: > > > > > > But that's not quite what the RFC says: > > > > > I am asking that we discuss and vote on the following question: > > > > > > “Should there be some way for developers to signal to the parser at > > > compile time that all unqualified

Re: [PHP-DEV] [RFC] Add Directive to Make All Namespaced Function Calls Global

2024-08-04 Thread Ilija Tovilo
Hi Nick On Sun, Aug 4, 2024 at 7:29 PM Nick Lockheart wrote: > > So I wanted to get a "yes" from the people who need to say yes, then > discuss all of those things you mentioned: > > 1. File level vs global > 2. Syntax > 3. Alternative options > > But I think we need a "yes" for the concept first

Re: [PHP-DEV] [Concept] Flip relative function lookup order (global, then local)

2024-08-04 Thread Ilija Tovilo
Hi Claude On Fri, Aug 2, 2024 at 9:02 PM Claude Pache wrote: > > I propose the following alternative approach: > > * establish a restricted whitelist of global functions for which the > performance gain would be noteworthy if there wasn’t any need to look at > local scope first; > > * for those

Re: [PHP-DEV] [Concept] Flip relative function lookup order (global, then local)

2024-08-04 Thread Ilija Tovilo
Hi Rob On Fri, Aug 2, 2024 at 7:10 PM Rob Landers wrote: > > So, what you’re saying is that symfony and laravel can get a performance > increase by simply adding a \ in the right places? Why don’t they do that > instead of changing the language? Nothing, of course. However, a Symfony maintaine

Re: [PHP-DEV] [RFC] Add Directive to Make All Namespaced Function Calls Global

2024-08-04 Thread Ilija Tovilo
Hi Nick I find it a bit unfortunate that you gave my thread barely any time to be discussed. On Sun, Aug 4, 2024 at 1:42 PM Nick Lockheart wrote: > > I would like to discuss and then vote on this proposal as a feature, > without getting into any specifics of syntax. > > I propose that we vote ye

[PHP-DEV] [Concept] Flip relative function lookup order (global, then local)

2024-08-02 Thread Ilija Tovilo
Hi everyone As you probably know, a common performance optimization in PHP is to prefix global function calls in namespaced code with a `\`. In namespaced code, relative function calls (meaning, not prefixed with `\`, not imported and not containing multiple namespace components) will be looked up

[PHP-DEV] Require C11 in PHP 8.4

2024-08-01 Thread Ilija Tovilo
Hi everyone We've gotten a bug report about compile errors in the PHP 8.4 alpha on old C99 compilers (and on some modern compilers when passing the -std=c99 flag). Specifically, C99 does not support typedef redeclarations, which is a C11 feature. ```c // some_header.h typedef struct _zval_struct

Re: [PHP-DEV] Request for opinions: bug vs feature - change intokenization of yield from

2024-07-21 Thread Ilija Tovilo
Hi Juliette On Sat, Jul 20, 2024 at 6:40 PM Juliette Reinders Folmer wrote: > > On 20-7-2024 18:04, Tim Düsterhus wrote: > > As I've said: I agree that the current situation is unfortunate. But the > correct solution is not "disallow comments", but "split the T_YIELD_FROM into > T_YIELD T_WHITE

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

2024-07-20 Thread Ilija Tovilo
Hi Rob On Sat, Jul 20, 2024 at 3:47 PM Rob Landers wrote: > > On Sat, Jul 20, 2024, at 03:14, Larry Garfield wrote: > > On Wed, May 29, 2024, at 2:15 PM, Larry Garfield wrote: > > > > https://wiki.php.net/rfc/asymmetric-visibility-v2 > > Hi folks. After a side quest to polish off hooks, we're ne

Re: [PHP-DEV] Sync CODEOWNERS

2024-07-18 Thread Ilija Tovilo
Hi Christoph On Thu, Jul 18, 2024 at 2:09 PM Christoph M. Becker wrote: > > So I suggest to sync CODEOWNERS for all active branches (and maybe even > security branches). > > What do you think? I think back when it was introduced it wasn't clear (at least to me) that PRs would request reviews bas

Re: [PHP-DEV] [RFC] Property Hook improvements

2024-07-10 Thread Ilija Tovilo
Hi Derick On Wed, Jul 10, 2024 at 11:32 AM Derick Rethans wrote: > > On Mon, 1 Jul 2024, Larry Garfield wrote: > > > > > https://wiki.php.net/rfc/hook_improvements > > 1. Remove the proactive guard against recursive backing value access > > "which would eventually trigger a stack overflow

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

2024-07-01 Thread Ilija Tovilo
Hi Yuya! On Sat, Jun 29, 2024 at 11:11 PM youkidearitai wrote: > > 2024年4月9日(火) 7:55 youkidearitai : > > > > Mainly review and approve pull request to mbstring extension. > > (probably everything related to Unicode and other character encoding) > > Alex Dowad (alexdowad) suggested that give to me

Re: [PHP-DEV] [Early Feedback] Pattern matching

2024-06-26 Thread Ilija Tovilo
Hi Rob On Wed, Jun 26, 2024 at 10:36 PM Rob Landers wrote: > >> On Wed, Jun 26, 2024, at 21:50, Morgan wrote: >> >> So the issue has nothing to do with this hypothetical infinity of >> unobservable nulls, and comes entirely down to the fact that with this >> pattern a variable may pass >> a) beca

Re: [PHP-DEV] [Early Feedback] Pattern matching

2024-06-25 Thread Ilija Tovilo
Hi Rob On Tue, Jun 25, 2024 at 9:05 AM Rob Landers wrote: > > On Tue, Jun 25, 2024, at 01:20, Ilija Tovilo wrote: > > On Mon, Jun 24, 2024 at 9:54 PM Robert Landers > wrote: > > > > To be honest, this is one of the smaller concerns I have with the new >

Re: [PHP-DEV] [Early Feedback] Pattern matching

2024-06-24 Thread Ilija Tovilo
On Mon, Jun 24, 2024 at 9:54 PM Robert Landers wrote: > > > The first means b is an optional key, but if it’s there, can only be a > > string. The second says b is a required key, but it may be a string or > > null. If there were a binding involved, that determines the type of the > > binding i

Re: [PHP-DEV] Re: RFC karma request

2024-06-20 Thread Ilija Tovilo
Hi Bilage On Thu, Jun 20, 2024 at 7:55 PM Bilge wrote: > > > > Re: Static class, I would like to propose an RFC for this feature. My > > wiki account is: bilge. > > > > Cheers, > > Bilge > > > If there is some reason why I should not be able to do this, please let > it be known. Sorry for the de

Re: [PHP-DEV] [RFC] Static Constructor

2024-06-19 Thread Ilija Tovilo
Hi Erick On Wed, Jun 19, 2024 at 2:34 PM Erick de Azevedo Lima wrote: > > You can read the RFC here: > https://wiki.php.net/rfc/static_constructor I see that you're using zend_class_init_statics() as a hook to call __static_construct(). This makes the initialization order unpredictable, because

Re: [PHP-DEV] Wiki registration and request RFC karma

2024-06-18 Thread Ilija Tovilo
Hi Erick On Mon, Jun 17, 2024 at 11:46 PM Erick de Azevedo Lima wrote: > > I've been reading the internals mailing list for some time and giving my 2 > cents here and there. > Now I have created a new wiki account (erickcomp) and I'd like to request RFC > karma for a new RFC I worked on during

Re: [PHP-DEV] Property hooks, and &get-only write behavior

2024-06-13 Thread Ilija Tovilo
Hi Gina On Thu, Jun 13, 2024 at 3:24 AM Gina P. Banyard wrote: > > On Wednesday, 12 June 2024 at 16:06, Ilija Tovilo > wrote: > > > Hi everyone > > > > [...] > > > > I hope that these semantics are acceptable for everyone. > > > > Ilija &g

[PHP-DEV] Property hooks, and &get-only write behavior

2024-06-12 Thread Ilija Tovilo
Hi everyone While reviewing the property hooks patch, Bob found a discrepancy in the implementation and the specification. There is an unfortunate mistake in one of the examples that suggests specific by-reference behavior that we did not intend to support. Specifically, from https://wiki.php.net

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

2024-06-05 Thread Ilija Tovilo
Hi Tim On Tue, Jun 4, 2024 at 7:54 PM Tim Düsterhus wrote: > > One thing that would get pretty wonky would be private-read properties: > Private property names are currently internally "mangled" to include the > class name. This allows to define the same private property in multiple > classes of

Re: [PHP-DEV] Fwd: Request for RFC Karma to Propose any_empty and all_empty Methods

2024-06-03 Thread Ilija Tovilo
Hi Elminson! On Mon, May 27, 2024 at 6:51 PM Elminson De Oleo Baez wrote: > > I hope this message finds you well. I am writing to request RFC karma for my > wiki account in order to propose a new RFC. > > My proposal involves the introduction of two new methods, any_empty and > all_empty, for w

Re: [PHP-DEV] [RFC] [Vote] #[\Deprecated] attribute

2024-06-03 Thread Ilija Tovilo
Hi Matthew On Mon, Jun 3, 2024 at 3:15 PM Matthew Weier O'Phinney wrote: > > On Wed, May 22, 2024 at 2:24 AM Benjamin Außenhofer > wrote: >> >> The vote for the RFC #[\Deprecated] attribute is now open: >> >> https://wiki.php.net/rfc/deprecated_attribute >> >> Voting will close on Wednesday 5th

Re: [PHP-DEV] [RFC] Transform exit() from a language construct into a standard function

2024-05-28 Thread Ilija Tovilo
On Tue, May 28, 2024 at 2:10 PM Gina P. Banyard wrote: > > On Monday, 27 May 2024 at 02:31, Ilija Tovilo wrote: > > > > On Wednesday, 8 May 2024 at 14:40, Gina P. Banyard intern...@gpb.moe > > > wrote: > > > > > > > I would like to f

Re: [PHP-DEV] [RFC] Transform exit() from a language construct into a standard function

2024-05-26 Thread Ilija Tovilo
Hi Gina On Sun, May 26, 2024 at 11:47 PM Gina P. Banyard wrote: > > On Wednesday, 8 May 2024 at 14:40, Gina P. Banyard wrote: > > > > > I would like to formally propose my idea for exit() as a function brought > > up to the list on 2024-02-24 [1] with the following RFC: > > https://wiki.php.net

Re: [PHP-DEV] [DISCUSSION] Checking uninitialized class properties

2024-05-20 Thread Ilija Tovilo
On Sat, May 18, 2024 at 4:41 PM Rowan Tommins [IMSoP] wrote: > > On 18/05/2024 11:52, Luigi Cardamone wrote: > > Are there any downsides in adding a > > specific syntax to check if a property > > is initialized with any value? > > In my opinion - and I stress that others may not share this opinion

Re: [PHP-DEV] [Discussion] Why can't I do "{$a::class}"?

2024-05-19 Thread Ilija Tovilo
On Sun, May 19, 2024 at 1:15 PM Ilija Tovilo wrote: > > Hi Peter > > On Sun, May 19, 2024 at 10:30 AM Peter Stalman wrote: > > > > echo " {A::$static_property} \n"; // doesn't work (unless $static_property > > is a variable) > > echo "

Re: [PHP-DEV] [Discussion] Why can't I do "{$a::class}"?

2024-05-19 Thread Ilija Tovilo
Hi Peter On Sun, May 19, 2024 at 10:30 AM Peter Stalman wrote: > > echo " {A::$static_property} \n"; // doesn't work (unless $static_property is > a variable) > echo " {$a::$static_property} \n"; // works > > echo " {A::static_method()} \n"; // doesn't work (just text) > echo " {$a::static_metho

Re: [PHP-DEV] [DISCUSSION] Checking uninitialized class properties

2024-05-17 Thread Ilija Tovilo
Hi Luigi On Fri, May 17, 2024 at 11:40 PM Luigi Cardamone wrote: > > Here is an example to describe my problem. Imagine a simple > DTO like this: > > class MyDTO{ > public ?int $propA; > public ?int $propB; > } > > Imagine that a Form processor or a generic mapper fill some of > these fie

Re: [PHP-DEV] [RFC] [Vote] Type Guards for Classes

2024-05-16 Thread Ilija Tovilo
Hi Patrik On Thu, May 16, 2024 at 10:31 PM Patrik Václavek wrote: > > Introduce a new type guard syntax for classes: > > ```php > (Foo) $variable; > ``` > > This syntax will internally perform the following operations: > > 1. Check if `$variable` is an instance of `Foo`. > 2. If the check fails,

[PHP-DEV] Introduce ReflectionConstant

2024-04-15 Thread Ilija Tovilo
Hi everyone We recently received a feature request to allow reflection of global constants, primarily to check whether they are deprecated. https://github.com/php/php-src/issues/13570 I created a simple PR to introduce a minimal `ReflectionConstant` class. https://github.com/php/php-src/pull/1366

Re: [PHP-DEV] [RFC][Vote announcement] Property hooks

2024-04-14 Thread Ilija Tovilo
Hi Matthew We're going to skip over the reiterations of Juliettes arguments, as they have already been responded to. On Thu, Apr 11, 2024 at 12:08 AM Matthew Weier O'Phinney wrote: > > On Mon, Apr 8, 2024 at 4:41 PM Ilija Tovilo wrote: >> >> https://externals.io/me

Re: [PHP-DEV] [RFC][Vote announcement] Property hooks

2024-04-11 Thread Ilija Tovilo
Hi Juliette On 9-4-2024 16:03, Juliette Reinders Folmer wrote: > On 8-4-2024 23:39, Ilija Tovilo wrote: >> >> https://wiki.php.net/rfc/property-hooks >> > > I realize it is late in the discussion period to speak up, but for months > I've been trying to find th

Re: [PHP-DEV] [RFC][Vote announcement] Property hooks

2024-04-09 Thread Ilija Tovilo
Hi Robert On Tue, Apr 9, 2024 at 9:34 PM Robert Landers wrote: > > On Tue, Apr 9, 2024 at 8:56 PM Larry Garfield wrote: > > > > The Aviz RFC was put to a vote last year but didn't pass. > > It would be really nice if votes weren't just a yes/no vote, but > yes/needs-more-work/no vote, where need

[PHP-DEV] [RFC][Vote announcement] Property hooks

2024-04-08 Thread Ilija Tovilo
Hi everyone Heads-up: Larry and I would like to start the vote of the property hooks RFC tomorrow: https://wiki.php.net/rfc/property-hooks We have worked long and hard on this RFC, and hope that we have found some middle-ground that works for the majority. One last concern we have not officially

Re: [PHP-DEV] [RFC][Concept] Data classes (a.k.a. structs)

2024-04-06 Thread Ilija Tovilo
Hi Rowan On Fri, Apr 5, 2024 at 12:28 AM Rowan Tommins [IMSoP] wrote: > > On 03/04/2024 00:01, Ilija Tovilo wrote: > > Regardless of the implementation, there are a lot of interactions we will > want to consider; and we will have to keep considering new ones as we add to >

Re: [PHP-DEV] Proposal: retrieve line, filename and if user defined for ReflectionAttribute

2024-04-05 Thread Ilija Tovilo
Hi Joel On Fri, Apr 5, 2024 at 3:10 PM Joel Wurtz wrote: > > Like a lot of libraries, we offer the possibility to configure behaviors with > Attributes. However in some cases it's wrongly configured by the user and > this wrong configuration cannot be detected on the attribute constructor but

Re: [PHP-DEV] RFC idea: using the void type to control maximum arity of user-defined functions

2024-04-04 Thread Ilija Tovilo
On Thu, Apr 4, 2024 at 5:58 PM Tim Düsterhus wrote: > > On 4/4/24 16:36, Pablo Rauzy wrote: > > I strongly agree in theory, but this could break existing code, and > > moreover such a proposal was already rejected: > > https://wiki.php.net/rfc/strict_argcount > > The RFC is 9 years old by now. My

Re: [PHP-DEV] [RFC][Concept] Data classes (a.k.a. structs)

2024-04-03 Thread Ilija Tovilo
Hi Larry On Wed, Apr 3, 2024 at 12:03 AM Larry Garfield wrote: > > On Tue, Apr 2, 2024, at 6:04 PM, Ilija Tovilo wrote: > > > I think you misunderstood. The intention is to mark both call-site and > > declaration. Call-site is marked with ->method!(), while declaration &g

Re: [PHP-DEV] [RFC][Concept] Data classes (a.k.a. structs)

2024-04-02 Thread Ilija Tovilo
Hi Rowan On Tue, Apr 2, 2024 at 10:10 PM Rowan Tommins [IMSoP] wrote: > > On 02/04/2024 01:17, Ilija Tovilo wrote: > > I'd like to introduce an idea I've played around with for a couple of > weeks: Data classes, sometimes called structs in other languages (e.g. > Swi

Re: [PHP-DEV] [RFC][Concept] Data classes (a.k.a. structs)

2024-04-02 Thread Ilija Tovilo
Hi Niels On Tue, Apr 2, 2024 at 8:16 PM Niels Dossche wrote: > > On 02/04/2024 02:17, Ilija Tovilo wrote: > > Hi everyone! > > > > I'd like to introduce an idea I've played around with for a couple of > > weeks: Data classes, sometimes called structs

  1   2   3   4   >