Re: [PHP-DEV] [RFC] [Discussion] Add WHATWG compliant URL parsing API

2024-06-29 Thread Juris Evertovskis
On 2024-06-28 23:06, Máté Kocsis wrote: Hi Everyone, I've been working on a new RFC for a while now, and time has come to present it to a wider audience. Last year, I learnt that PHP doesn't have built-in support for parsing URLs according to any well established standards (RFC 1738 or the

[PHP-DEV] Loading SQLite extensions on PDO

2023-01-20 Thread Juris Evertovskis
Hey, internals! As many before me, I have come accross a need to load a SQLite extension. While it is supported on the SQLite3 interface, popular frameworks (namely Laravel) use solely PDO and loading extensions is not available on PDO. I've looked into the history of this issue and it seems tha

RE: [PHP-DEV] RFC: code optimizations

2023-03-05 Thread Juris Evertovskis
The current amount of secondary votes makes it feel daunting. I would suspect not all voters will think thoroughly about each of the questions. I suggest that most of these questions could be agreed upon in discussions before the vote. Maybe the RFC could propose a certain wording of the guidelin

[PHP-DEV] Optional interfaces

2024-11-15 Thread Juris Evertovskis
Hey all, If you try to implement an interface that does not exist, you get the 'Interface "%s" not found' error. Usually that's useful as it points to a code error. However, sometimes we want our code to be compatible with an optional library. For example, my Expression class might be compa

RE: [PHP-DEV] Return When

2024-11-26 Thread Juris Evertovskis
Here’s the previous RFC: https://wiki.php.net/rfc/conditional_break_continue_return And the previous discussion: https://externals.io/message/110107

RE: [PHP-DEV] Optional interfaces

2024-11-16 Thread Juris Evertovskis
Is there some reason you cannot do this: https://3v4l.org/hF1vr Unless I’m missing something, you can’t patch-define a namespaced OptionalInterface that easily. Anyway, I was not implying this is something impossible to accomplish. My point is that it would be beneficial to have synta

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

2024-12-28 Thread Juris Evertovskis
Hi, I would like to propose a new syntax that let's you implement an interface only if it exists. `class MyClass extends ?OptionalInterface {}` If the `OptionalInterface` exists, the class implements it. If no such interface can be found, it is ignored. https://wiki.php.net/rfc/opti

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

2025-02-09 Thread Juris Evertovskis
Hey, Thanks for all the feedback! The RFC is now expanded to explicitly address the concerns on how the optional interfaces interact with type checks, eval'd interfaces, opcache, autoloading, reflection and the Override attribute. Did Did I miss something? Please let me know if anything is

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

2025-02-07 Thread Juris Evertovskis
On 2025-02-07 06:57, Larry Garfield wrote: Hi folks. A few years ago I posted an RFC for a pipe operator, as seen in many other languages. At the time it didn't pass, in no small part because the implementation was a bit shaky and it was right before freeze. Nonetheless, there are now even mo

[PHP-DEV] RFC karma request

2024-12-14 Thread Juris Evertovskis
Hello, I would like to attempt an RFC on the "optional interfaces" feature that I mentioned a while ago: https://externals.io/message/125967 I've created a wiki account with username `tontonsb`. Could you please grant me the required privileges? Thanks, Juris

RE: [PHP-DEV] Discussion: Remove file statcache?

2024-12-21 Thread Juris Evertovskis
While it is nice the Symfony and WordPress wouldn't suffer a lot from dropping this cache, what's the impact on scripts that are processing hundreds of files? Would doing ` $stat = stat($filename);` instead of separate calls to `filemtime` and `filesize` actually be important? Or would it still am

Re: [PHP-DEV] [VOTE] Optional Interfaces

2025-03-15 Thread Juris Evertovskis
On 2025-03-14 10:09, Juris Evertovskis wrote: Hello, I've opened the vote on the Optional interfaces RFC. https://wiki.php.net/rfc/optional-interfaces Implementation: https://github.com/php/php-src/pull/17288 Discussion: https://externals.io/message/126185 The voting will be closed on

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

2025-03-15 Thread Juris Evertovskis
On 2025-03-14 16:24, Viktor Khramov wrote: Hey Juris. I have a question about this feature. At the example blow interface A { public function x(Foo $foo); } interface B { public function x(Bar $foo); } class Test implements ?A, ?B { } what would happen if both interfaces existed? Hi Vi

Re: [PHP-DEV] [VOTE] Optional Interfaces

2025-03-21 Thread Juris Evertovskis
On 2025-03-20 18:09, Gina P. Banyard wrote: And another user [2] was basically suggesting my previous solution of adding support for type classes/runtime implementation of interfaces. Hey, There are two ideas -- the `$object implements Iface` that you suggested and the `SomeClass implements

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

2025-03-14 Thread Juris Evertovskis
On 2025-03-14 16:04, Jorg Sowa wrote: Hello Juris, There is some uncertainty for me on how this approach would work with namespaces. Let's get this example: https://3v4l.org/bI1Rj I would expect to get the error message that I forgot to insert `use Stringable;`. But with your idea everything

[PHP-DEV] [VOTE] Optional Interfaces

2025-03-14 Thread Juris Evertovskis
Hello, I've opened the vote on the Optional interfaces RFC. https://wiki.php.net/rfc/optional-interfaces Implementation: https://github.com/php/php-src/pull/17288 Discussion: https://externals.io/message/126185 The voting will be closed on 2025-03-29 00:00:00 UTC. BR, Juri

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

2025-04-05 Thread Juris Evertovskis
On 2025-03-20 18:50, Daniel Scherzer wrote: The original inspiration which I discussed in the RFC is fixing the signature of the BackedEnum methods, which currently use the second option. Hey, I'm not opposed to having a bottom type, but the `try`/`tryFrom` issue feels caused by another

Re: [PHP-DEV] [RFC] [Discussion] array_first() and array_last()

2025-04-06 Thread Juris Evertovskis
On 2025-04-05 18:51, Niels Dossche wrote: Hi internals I'm opening the discussion for the RFC "array_first() and array_last()". https://wiki.php.net/rfc/array_first_last Kind regards Niels Hi, Do you think it would be hard or wrong to add `array_nth`? I've had more trouble with that as th

[PHP-DEV] Usable classes?

2025-04-01 Thread Juris Evertovskis
Hello, Sorry, but I've got another idea. I already validated it with ChatGPT who labeled it spicy. After clarifying some misunderstandings, they updated the label to "heretical". I hope you'll find it exciting as well. As you're all aware, classes in PHP are literally unusable and impossibl

Re: [PHP-DEV] Concept: Lightweight error channels

2025-04-27 Thread Juris Evertovskis
On 2025-04-27 08:42, Larry Garfield wrote: There's two key problems with exceptions as PHP currently has them: 1. Creating and attaching the backtrace to them is stupidly expensive. It's one of the most expensive things you can ask the engine to do, I think. Would an EmptyBacktraceException so

Re: [PHP-DEV] Concept: Lightweight error channels

2025-05-01 Thread Juris Evertovskis
On 2025-04-29 17:29, Matthew Weier O'Phinney wrote: * Exceptions should not be used for normal application logic flow. If the "error" is recoverable and/or expected, use a different mechanism so you can use standard conditional branching. As such, there are a lot of situations where I may not

RE: [PHP-DEV] Concept: Lightweight error channels

2025-04-26 Thread Juris Evertovskis
Hi, Reading this as a PHP dev is confusing (terminology-wise) because errors used to be the fatal ("stop the world") conditions while exceptions were the catchable, recovarable issues within some call - feels to me pretty equivalent to what you're proposing here. What's the problem with PHP excep

[PHP-DEV] Fully overridable factory methods

2025-02-18 Thread Juris Evertovskis
Hi, A recent discussion brought up the need for multiple constructors for the same class. https://externals.io/message/126428 The need was mostly answered by suggestions to use factory methods. However on an earlier discussion it was discussed how it's fine and even useful for constructor

Re: [PHP-DEV] Fully overridable factory methods

2025-02-18 Thread Juris Evertovskis
On 2025-02-18 19:31, Rob Landers wrote: On Tue, Feb 18, 2025, at 17:52, Juris Evertovskis wrote: Hi, A recent discussion brought up the need for multiple constructors for the same class. https://externals.io/message/126428 The need was mostly answered by suggestions to use factory

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

2025-03-07 Thread Juris Evertovskis
On 2025-03-07 01:48, Rob Landers wrote: They're not 100% arbitrary, but mostly due to technical limitations. - One level deep: Nesting multiple levels results in ambiguous grammar. - As a parent class: This also results in ambiguity. - Abstract: If it cannot be a parent class, it doesn't make s

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

2025-03-04 Thread Juris Evertovskis
Hi all, It's almost awkward to bother the list with this humble RFC amidst so many exciting proposals :) With help from Ilija and Niels the implementation is now working and tested, so the RFC seems getting closer to the voting phase. Ilija raised a point about optional interfaces not b

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

2025-03-06 Thread Juris Evertovskis
On 2025-03-06 10:04, Tim Düsterhus wrote: - I don't understand the use of `private` properties. Given that the classes cannot have methods, they would be inaccessible, no? I think the RFC was a bit unclear on this. Short classes can have methods. The short syntax just doesn't provide the abil

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

2025-03-05 Thread Juris Evertovskis
Hi, Maybe I didn’t read the RFC carefully enough, but… Do any of these features require the other one? I’m asking because I wouldn’t want to see them both denied just because the voters disagree with one of them. Good luck with this proposal! Juris

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

2025-03-11 Thread Juris Evertovskis
Hey, Just a headsup that I plan to start the vote in a couple of days. Please let me know if there are concerns that might affect your stance on this proposal. https://wiki.php.net/rfc/optional-interfaces BR, Juris

RE: [PHP-DEV] [RFC] [Discussion] Add WHATWG compliant URL parsing API

2025-02-23 Thread Juris Evertovskis
-Original Message- From: Tim Düsterhus Sent: Sunday, February 23, 2025 5:05 PM To: Máté Kocsis Cc: Internals Subject: Re: [PHP-DEV] [RFC] [Discussion] Add WHATWG compliant URL parsing API > Naming of `WhatWgError` and `WhatWgErrorType`. They are placed within the `Uri\WhatWg` namespace

RE: [PHP-DEV] Using a cross-platform glob implementation on all platforms

2025-03-28 Thread Juris Evertovskis
-Original Message- From: Calvin Buckley Sent: Thursday, March 27, 2025 11:19 PM To: php internals Subject: [PHP-DEV] Using a cross-platform glob implementation on all platforms > CI is currently passing with this. Hi, It looks like you didn't have to adjust any tests. Can you clarify

RE: [PHP-DEV] [VOTE] Optional Interfaces

2025-03-29 Thread Juris Evertovskis
Hello, The voting has concluded with 15 votes in favor and 19 against. As such, the RFC has been declined. https://wiki.php.net/rfc/optional-interfaces Thank you all for taking the time to consider the proposal and casting your votes. I'm especially grateful to those who helped refine t

Re: [PHP-DEV] Usable classes?

2025-04-02 Thread Juris Evertovskis
On 2025-04-01 13:27, Tim Düsterhus wrote: Is this intended as a serious proposal? I've stopped reading halfway through, because depending on how the proposal is intended to be perceived, the appropriate response and the amount of reasonable time to spend on it would differ. Hi, I'm abusing t

RE: [PHP-DEV] [RFC] Deprecations for PHP 8.5

2025-07-08 Thread Juris Evertovskis
Hi, I'd like to add a bit to the harmful/useful debate. While writing a `->setAccessible(true)` is not harmful per se, it's a clear indication one is following an outdated example/tutorial. New code should never contain it, not even for consistency (which could be argued for `__sleep()` if you

RE: [PHP-DEV] [RFC][DISCUSSION] Object-oriented curl API v2

2025-06-27 Thread Juris Evertovskis
-Original Message- From: Eric Norris Sent: Thursday, June 26, 2025 7:25 PM To: PHP internals Subject: [PHP-DEV] [RFC][DISCUSSION] Object-oriented curl API v2 > I'd like to formally propose a restart of the original object-oriented curl > API RFC Cool. Calling functions with object as

RE: [PHP-DEV] Validating #[\Attribute] targets

2025-07-26 Thread Juris Evertovskis
Hey, > if you are not going to call ReflectionAttribute::newInstance(), then you > don't > really need to mark the trait/interface/enum/abstract class as an attribute. Personally I never knew the `#[\Attribute]` is only required to do `->newInstance()`. The docs make it seem like it’s