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

2025-04-30 Thread Morgan
On 2025-04-28 06:06, Larry Garfield wrote: Which is why I think we do want some kind of syntax similar to Rust's ?, so the above could be shortened back to this: function doStuff($id): string raises UserErr { $user = $repo->getUser($id) reraise; // We have a good user. } One thing about

Re: [PHP-DEV] [RFC] Throwable Hierarchy Policy for Extensions

2025-04-30 Thread Kamil Tekiela
On Wed, 30 Apr 2025 at 21:13, Larry Garfield wrote: > >> […] just that it's the only time I've seen $code used in the wild... > >> > > > > PDO (for better or worse) also uses the `$code` for the error code > > returned by the database. Unfortunately it also widens the (untyped) > > $code from int

Re: [PHP-DEV] [RFC] Throwable Hierarchy Policy for Extensions

2025-04-30 Thread Larry Garfield
On Wed, Apr 30, 2025, at 1:06 PM, Tim Düsterhus wrote: > Hi > > On 4/30/25 15:33, Larry Garfield wrote: >> The only time I've seen anyone use $code is in TYPO3. Their coding >> standards say that any time you throw an exception, you use the current >> timestamp (determined manually) as a code.

Re: [PHP-DEV] [RFC] Throwable Hierarchy Policy for Extensions

2025-04-30 Thread Tim Düsterhus
Hi On 4/30/25 13:18, Derick Rethans wrote: - Exceptions MUST NOT be ``final``. Could the RFC explain why not? I'm not sure if this is useful to add to the RFC itself as a “only extra explanation” and since the discussion is an equally official resource: The reason is to allow flexible exte

Re: [PHP-DEV] [RFC] Throwable Hierarchy Policy for Extensions

2025-04-30 Thread Tim Düsterhus
Hi On 4/30/25 15:33, Larry Garfield wrote: The only time I've seen anyone use $code is in TYPO3. Their coding standards say that any time you throw an exception, you use the current timestamp (determined manually) as a code. That way there is a globally unique code regardless of exception t

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

2025-04-30 Thread ignace nyamagana butera
Hi Máté and Tim Why can't the Url::resolve method also expose the `$errors` parameter like the constructor and the parse static method ? As far as I understand it nothing prevents the API from exposing the errors during URI resolution which is a proxy method for the constructor call just like the

Re: [PHP-DEV] [RFC] Throwable Hierarchy Policy for Extensions

2025-04-30 Thread Larry Garfield
On Wed, Apr 30, 2025, at 6:18 AM, Derick Rethans wrote: > On Sun, 27 Apr 2025, Tim Düsterhus wrote: > - Any two exceptions with different causes MUST be identifiable either > by a unique exception class name, a stable ``$code``, or a > class-specific additional property suitable for programm

Re: [PHP-DEV] [RFC] [Discussion] Minor version compatibility

2025-04-30 Thread Christian Schneider
Am 27.04.2025 um 20:22 schrieb Gina P. Banyard : > I fundamentally reject the concept of this RFC to restrict our ability to do > input validation. I am sorry but I fail to see how the RFC restrict the ability to do input validation. > Emitting an E_DEPRECATED for invalid inputs remains utter n

Re: [PHP-DEV] [RFC] Throwable Hierarchy Policy for Extensions

2025-04-30 Thread Derick Rethans
On Sun, 27 Apr 2025, Tim Düsterhus wrote: > Hi > > as announced in the URI RFC discussion thread > (https://externals.io/message/123997#127142), I've now written up an > “Exception Hierarchy” policy RFC together with Gina. > > Please find the following links: > > RFC: https://wiki.php.net/rfc/e

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

2025-04-30 Thread Rowan Tommins [IMSoP]
On 29 April 2025 19:50:52 BST, "Tim Düsterhus" wrote: >I'm saying that I cannot add a private class Foo\Bar inside of the class Foo >without checking whether a class Bar inside a namespace Foo already exists, >since both would conflict. Even more problematic: I can't add a class Bar >inside

Re: [PHP-DEV] Oniguruma maintenance was ended on 2025-04-24

2025-04-30 Thread youkidearitai
2025年4月30日(水) 17:13 Anton Smirnov : > > On 30/04/2025 08:05, youkidearitai wrote: > > Hi, Internals > > > > Oniguruma(鬼車) maintenance was ended on April 24, 2025. > > https://github.com/kkos/oniguruma > > This library uses mbregex in php-src. > > > > There is forked library in Onigumo(鬼雲). > > http

Re: [PHP-DEV] Oniguruma maintenance was ended on 2025-04-24

2025-04-30 Thread Anton Smirnov
On 30/04/2025 08:05, youkidearitai wrote: Hi, Internals Oniguruma(鬼車) maintenance was ended on April 24, 2025. https://github.com/kkos/oniguruma This library uses mbregex in php-src. There is forked library in Onigumo(鬼雲). https://github.com/k-takata/Onigmo How do we do that? - Move to Onigumo

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

2025-04-30 Thread ignace nyamagana butera
Hi Máté and Tim I read the following in the RFC >Withers of Uri\WhatWg\Url follow the relevant “setter steps” that are defined by WHATWG URL. Unfortunately, these algorithms sometimes have surprising behavior where modification fails silently, and t