Re: [PHP-DEV] [RFC] Optional Catch Block Body

2025-07-31 Thread Rob Landers
On Thu, Jul 31, 2025, at 17:33, Rowan Tommins [IMSoP] wrote: > On 31/07/2025 15:17, Rob Landers wrote: > > They're not used for flow control, or state. They merely force PHP to > > unwind the stack to a known place > > > I don't understand the distinction he

Re: [PHP-DEV] [RFC] Optional Catch Block Body

2025-07-31 Thread Rob Landers
On Thu, Jul 31, 2025, at 15:32, Christian Schneider wrote: > Am 31.07.2025 um 09:10 schrieb Rob Landers : > > I can see something like this being useful in niche applications. For > > example, I have a proxy generation class that creates something like this: > > > >

[PHP-DEV] references & arrays + hooks

2025-07-31 Thread Rob Landers
Hello internals: Currently, this is not allowed by PHP: class Foo { public function __construct( public string &$ref { get => $this->ref ?? 'null'; set => $this->ref = $value; } ) {} } $var = 'hello'; $foo = new Foo($var); $var = "world"; echo $foo->ref; https://3v4l.org/JRArK Curre

Re: [PHP-DEV] [RFC] Optional Catch Block Body

2025-07-31 Thread Rob Landers
On Thu, Jul 31, 2025, at 06:53, Mihail Liahimov wrote: > Introduction > > Currently, PHP requires a block body for catch clauses even when the caught > exception is not used. This results in unnecessary boilerplate code. This RFC > proposes allowing catch clauses without a body when the exceptio

Re: [PHP-DEV] [RFC] Warnings for PHP 8.5

2025-07-29 Thread Rob Landers
On Tue, Jul 29, 2025, at 13:16, Alexandru Pătrănescu wrote: > > On Tue, Jul 29, 2025 at 12:18 PM Rob Landers wrote: >> __ >> >> I am not sure that (int)"INF" or (int)"NAN" is misbehaving. (int)"Password" >> also produces

Re: [PHP-DEV] [RFC] Warnings for PHP 8.5

2025-07-29 Thread Rob Landers
On Tue, Jul 29, 2025, at 11:01, Gina P. Banyard wrote: > On Monday, 28 July 2025 at 19:08, Ilija Tovilo wrote: > > > Hi Gina > > > > On Mon, Jul 28, 2025 at 7:15 PM Gina P. Banyard intern...@gpb.moe wrote: > > > > > I find it increasingly frustrating that trying to make PHP not be > > > comple

Re: [PHP-DEV] [DISCUSSION] User-land Throwable

2025-07-28 Thread Rob Landers
On Mon, Jul 28, 2025, at 19:54, Kamil Tekiela wrote: > > > On Mon 28 Jul 2025, 20:50 Dmitry Derepko, wrote: >> >> On Mon, Jul 28, 2025 at 3:26 PM Rob Landers wrote: >>> >>> Wouldn’t a better approach be to allow serializing/deserializing exceptions? &

Re: [PHP-DEV] [DISCUSSION] User-land Throwable

2025-07-28 Thread Rob Landers
On Mon, Jul 28, 2025, at 11:41, Dmitry Derepko wrote: > Hello PHP Internals, > > I would like to propose a discussion regarding two current limitations in > PHP's exception handling system that I believe could be addressed to improve > flexibility and developer experience. > > A few years ago

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

2025-07-26 Thread Rob Landers
On Sat, Jul 26, 2025, at 13:29, Juris Evertovskis wrote: > 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 r

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

2025-07-26 Thread Rob Landers
On Fri, Jul 25, 2025, at 18:33, Daniel Scherzer wrote: > Hi internals, > > The #[\Attribute] attribute is used to mark classes as being usable as > attributes. It currently does not trigger any error if added to a trait, > interface, enum, or abstract class. However, if any of those *were* use

Re: [PHP-DEV] [RFC] Readonly property hooks

2025-07-22 Thread Rob Landers
On Tue, Jul 22, 2025, at 12:17, Claude Pache wrote: > > >> Le 22 juil. 2025 à 11:25, Rob Landers a écrit : >> >> >>> >>>> Should I be able to mark this class as readonly? I would think so. >>> >>> I don’t think so. >>&

Re: [PHP-DEV] [RFC] Readonly property hooks

2025-07-22 Thread Rob Landers
On Tue, Jul 22, 2025, at 11:18, Claude Pache wrote: > > >> Le 22 juil. 2025 à 09:43, Rob Landers a écrit : >> >> You can also implement this today, without using readonly: >> >> class Foo { >> public int $bar { >> get => $this->bar;

Re: [PHP-DEV] [RFC] Readonly property hooks

2025-07-22 Thread Rob Landers
On Tue, Jul 22, 2025, at 02:10, Eric Norris wrote: > On Sun, Jul 20, 2025 at 4:19 PM Rob Landers wrote: > > > > > > > > On Sun, Jul 20, 2025, at 19:18, Eric Norris wrote: > > > > Hi Rob, > > > > I'm going to respond to a few points from

Re: [PHP-DEV] RFC: Records

2025-07-21 Thread Rob Landers
On Mon, Jul 21, 2025, at 13:02, Nick wrote: > >> On 17. Nov 2024, at 06:14, 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! >> >

Re: [PHP-DEV] [RFC] Readonly property hooks

2025-07-20 Thread Rob Landers
On Sun, Jul 20, 2025, at 19:18, Eric Norris wrote: > Hi Rob, > > I'm going to respond to a few points from earlier emails here instead > of each one. > > On Sat, Jul 19, 2025 at 6:13 AM Rob Landers wrote: > > > > > > > > On Sat, Jul 19, 2025, a

Re: [PHP-DEV] [RFC] [meta] Readonly property hooks

2025-07-19 Thread Rob Landers
On Fri, Jul 18, 2025, at 14:10, Tim Düsterhus wrote: > Hi > > Apologies for the belated reply. I was busy with getting my own > implementation wrapped up and the thread was so active that I had > troubles keeping up. Hi Tim, Thanks for taking the time to reply. That said, I would like to addre

Re: [PHP-DEV] [RFC] Readonly property hooks

2025-07-19 Thread Rob Landers
On Sat, Jul 19, 2025, at 12:09, Claude Pache wrote: > > >> Le 19 juil. 2025 à 09:46, Rob Landers a écrit : >> >> >> >> On Sat, Jul 19, 2025, at 03:04, Claude Pache wrote: >>> >>> >>> >>>> Le 19 juil. 2025 à 00:4

Re: [PHP-DEV] Re: [RFC] Readonly property hooks

2025-07-19 Thread Rob Landers
On Sat, Jul 19, 2025, at 03:04, Claude Pache wrote: > > > >> Le 19 juil. 2025 à 00:41, Rob Landers a écrit : >> >> The original author (Nikita) suggested that there's nothing in the original >> design that precludes accessors -- and highlights langu

Re: [PHP-DEV] Re: [RFC] Readonly property hooks

2025-07-18 Thread Rob Landers
On Fri, Jul 18, 2025, at 21:43, Eric Norris wrote: > Nick, Larry, > > On Fri, Jul 18, 2025 at 2:01 PM Nicolas Grekas > mailto:nicolas.grekas%2b...@gmail.com>> wrote: > > > > > > > > Le ven. 18 juil. 2025 à 18:32, Tim Düsterhus a écrit : > >> > >> Hi > >> > >> On 7/17/25 18:26, Larry Garfield wr

Re: [PHP-DEV] [RFC] Readonly property hooks

2025-07-18 Thread Rob Landers
On Fri, Jul 18, 2025, at 18:48, Eric Norris wrote: > On Fri, Jul 18, 2025 at 12:01 PM Rob Landers wrote: > > > > > > > > On Fri, Jul 18, 2025, at 17:25, Tim Düsterhus wrote: > > > > Hi > > > > On 7/14/25 15:38, Larry Garfield wrote: > >

Re: [PHP-DEV] [RFC] Readonly property hooks

2025-07-18 Thread Rob Landers
On Fri, Jul 18, 2025, at 17:25, Tim Düsterhus wrote: > Hi > > On 7/14/25 15:38, Larry Garfield wrote: > > Thanks, Ilija. You expressed my concerns as well. And yes, in practice, > > readonly classes over-reaching is the main use case; if you're marking > > individual properties readonly, the

Re: [PHP-DEV] [RFC] Readonly property hooks

2025-07-17 Thread Rob Landers
On Thu, Jul 17, 2025, at 15:10, Eric Norris wrote: > On Thu, Jul 17, 2025 at 3:31 AM Rob Landers wrote: > > > > On Tue, Jul 15, 2025, at 19:27, Nicolas Grekas wrote: > > > > > > > > Le lun. 14 juil. 2025 à 15:41, Larry Garfield a > > écrit : &g

Re: [PHP-DEV] [RFC] Readonly property hooks

2025-07-17 Thread Rob Landers
On Tue, Jul 15, 2025, at 19:27, Nicolas Grekas wrote: > > > Le lun. 14 juil. 2025 à 15:41, Larry Garfield a > écrit : >> On Sun, Jul 13, 2025, at 6:28 PM, Ilija Tovilo wrote: >> > Hi Nick >> > >> > On Fri, Jul 11, 2025 at 6:31 AM Nick wrote: >> >> >> >>> On 8. Jun 2025, at 11:16, Larry Garfiel

Re: [PHP-DEV] RFC: Records

2025-07-16 Thread Rob Landers
On Tue, Jul 15, 2025, at 19:05, Nicolas Grekas wrote: > Not sure it's really a contribution to the discussion but in case you missed > it, you can make public properties "public(set)": > > final readonly class Response { > public function __construct( > public public(set) int $statusC

Re: [PHP-DEV] Discussion Short Constructor

2025-07-16 Thread Rob Landers
On Wed, Jul 16, 2025, at 17:44, Deleu wrote: > > > On Wed, Jul 16, 2025 at 3:49 AM Rob Landers wrote: >> __ >> >> Why I haven't proposed it as a separate RFC: with PSR-4 being so popular, >> nobody is going to write one-line files to take advantage

Re: [PHP-DEV] Discussion Short Constructor

2025-07-15 Thread Rob Landers
On Tue, Jul 15, 2025, at 20:07, Dmitry Derepko wrote: > Hi, > > I've found a discussion about Records https://externals.io/message/125975 and > found a one key point which I really like in Kotlin (hello): short > constructors. > > Rob said that short constructor will be probably removed: >> 1.

Re: [PHP-DEV] [RFC] Warnings for PHP 8.5

2025-07-15 Thread Rob Landers
On Mon, Jul 14, 2025, at 18:20, Gina P. Banyard wrote: > Hello internals, > > Similar to the mass deprecation RFC, I would like to propose the addition of > a few warnings in certain situations: > https://wiki.php.net/rfc/warnings-php-8-5 > > I am expecting these 4 sub-proposals to be mostly unc

Re: [PHP-DEV] RFC: Records

2025-07-14 Thread Rob Landers
Hey Dmitry, Please remember to bottom post! On Mon, Jul 14, 2025, at 11:16, Dmitry Derepko wrote: > Hi, Rob! > > I'm just wondering, why the implementation differs from a regular class? > > Record makes a "class" immutable and unique, using field value comparison > instead of object refs. It

Re: [PHP-DEV][RFC] Deprecate type juggling to and from bool type within the function type juggling context

2025-07-12 Thread Rob Landers
On Sat, Jul 12, 2025, at 01:29, Theodore Brown wrote: > On Fri, July 11, 2025 at 05:00 G. P. Banyard wrote: > > >> On Monday, 30 June 2025 at 10:26, Nicolas Grekas wrote: > >> ... > >> The latter, cast-from-bool, I think they're all useful improvements. While > >> most likely harmless in al

Re: [PHP-DEV] [RFC] Readonly property hooks

2025-07-11 Thread Rob Landers
On Fri, Jul 11, 2025, at 13:40, Nick wrote: > >> On 11. Jul 2025, at 01:43, Rob Landers wrote: >> >> On Thu, Jul 10, 2025, at 17:34, Larry Garfield wrote: >>> On Thu, Jul 10, 2025, at 5:43 AM, Tim Düsterhus wrote: >>> > Hi >>> > >>&g

Re: [PHP-DEV] [RFC] Readonly property hooks

2025-07-10 Thread Rob Landers
On Fri, Jul 11, 2025, at 02:40, Nick wrote: > Hey Rob, > >> On 11. Jul 2025, at 01:43, Rob Landers wrote: >>> >>> Nick previously suggested having the get-hook's first return value cached; >>> it would still be subsequently called, so any side eff

Re: [PHP-DEV] [RFC] Readonly property hooks

2025-07-10 Thread Rob Landers
On Thu, Jul 10, 2025, at 17:34, Larry Garfield wrote: > On Thu, Jul 10, 2025, at 5:43 AM, Tim Düsterhus wrote: > > Hi > > > > Am 2025-07-08 17:32, schrieb Nicolas Grekas: > >> I also read Tim's argument that new features could be stricter. If one > >> wants to be stricter and forbid extra behavio

Re: [PHP-DEV] [RFC] Readonly property hooks

2025-07-09 Thread Rob Landers
On Wed, Jul 9, 2025, at 13:39, Nicolas Grekas wrote: > Thanks for your detailed thoughts, Claude. I'd like to offer my perspective > on some of the points you raised. > > Le mer. 9 juil. 2025 à 12:53, Claude Pache a écrit : >> >> >>> Le 8 juil. 2025 à 17:32, Nicolas Grekas >>

Re: [PHP-DEV] ::from() and tryFrom() on Basic Enums

2025-07-09 Thread Rob Landers
On Wed, Jul 9, 2025, at 15:29, Deleu wrote: > Hi people! > > Today I tried to do `ResourceType::from()` and was surprised that my IDE > immediately screamed at me. After further investigation, I realized that > Basic Enums (this is what the RFC called it [1]) does not have these > commodities

Re: [PHP-DEV] [Discussion][RFC Idea] Cast Variables by Reference

2025-07-07 Thread Rob Landers
On Mon, Jul 7, 2025, at 18:41, Rob Landers wrote: > > > On Mon, Jul 7, 2025, at 18:22, Joseph Leedy wrote: >> Hello, I'm Joseph, or Seph for short. I'm a long time listener, but a >> first-time caller. I've had an idea rattling around in my noggin for a w

Re: [PHP-DEV] [Discussion][RFC Idea] Cast Variables by Reference

2025-07-07 Thread Rob Landers
On Mon, Jul 7, 2025, at 18:22, Joseph Leedy wrote: > Hello, I'm Joseph, or Seph for short. I'm a long time listener, but a > first-time caller. I've had an idea rattling around in my noggin for a while > that I'd like your feedback on: > > As a developer, I would like to have variables of one

Re: [PHP-DEV] Re: [RFC] [Discussion] #[\DelayedTargetValidation] attribute

2025-07-05 Thread Rob Landers
On Sat, Jul 5, 2025, at 21:53, Daniel Scherzer wrote: > On Fri, Jul 4, 2025 at 4:50 PM Rob Landers wrote: >> __ >> >> On Sun, Jun 22, 2025, at 22:00, Daniel Scherzer wrote: >>> On Tue, Jun 17, 2025 at 4:26 PM Daniel Scherzer >>> wrote: >>>

Re: [PHP-DEV] Re: [RFC] [Discussion] #[\DelayedTargetValidation] attribute

2025-07-04 Thread Rob Landers
On Sun, Jun 22, 2025, at 22:00, Daniel Scherzer wrote: > On Tue, Jun 17, 2025 at 4:26 PM Daniel Scherzer > wrote: >> Hi internals, >> >> I'd like to start the discussion for a new RFC about adding a >> `#[\DelayedTargetValidation]` attribute. >> >> * RFC: https://wiki.php.net/rfc/delayedtarge

Re: [PHP-DEV] [RFC idea] Target-aware attributes

2025-07-04 Thread Rob Landers
On Sat, Jul 5, 2025, at 00:47, Andreas Hennings wrote: > On Sat, 5 Jul 2025 at 00:11, Rob Landers wrote: > > > > > > > > On Fri, Jul 4, 2025, at 17:21, Andreas Hennings wrote: > > > > On Fri, 4 Jul 2025 at 06:30, Stephen Reay wrote: > > > &g

Re: [PHP-DEV] [RFC] Partial Function Application v2

2025-07-04 Thread Rob Landers
On Sat, Jun 28, 2025, at 07:06, Larry Garfield wrote: > Hi folks. Arnaud and I would like to present take-2 at Partial Function > Application. > > https://wiki.php.net/rfc/partial_function_application_v2 > > It is largely similar to the previous PFA proposal from 2021, though there > are a n

Re: [PHP-DEV] [RFC idea] Target-aware attributes

2025-07-04 Thread Rob Landers
On Fri, Jul 4, 2025, at 17:21, Andreas Hennings wrote: > On Fri, 4 Jul 2025 at 06:30, Stephen Reay wrote: > > > > > > > > On 4 Jul 2025, at 00:54, Andreas Hennings wrote: > > > > On Thu, 3 Jul 2025 at 19:17, Stephen Reay wrote: > > > > > > > > > > > > Sent from my iPhone > > > > On 3 Jul 2025,

Re: [PHP-DEV] Year 2038 issue

2025-06-18 Thread Rob Landers
On Wed, Jun 18, 2025, at 13:18, Marc Bennewitz wrote: > > > On 16.06.25 19:01, Yogarine wrote: >> Hi all, >> >> On 16 Jun 2025, at 17:24, Rob Landers wrote: >>> On Mon, Jun 16, 2025, at 16:54, Alexandru Pătrănescu wrote: >>>> On Mon, Jun 16, 20

Re: [PHP-DEV] [RFC] [Discussion] #[\DelayedTargetValidation] attribute

2025-06-18 Thread Rob Landers
On Wed, Jun 18, 2025, at 13:09, kont...@beberlei.de wrote: > > Von meinem iPhone gesendet > >> Am 18.06.2025 um 11:26 schrieb Rob Landers : >>  >> On Wed, Jun 18, 2025, at 01:26, Daniel Scherzer wrote: >>> Hi internals, >>> >>> I'

Re: [PHP-DEV] [RFC] [Discussion] #[\DelayedTargetValidation] attribute

2025-06-18 Thread Rob Landers
On Wed, Jun 18, 2025, at 01:26, Daniel Scherzer wrote: > Hi internals, > > I'd like to start the discussion for a new RFC about adding a > `#[\DelayedTargetValidation]` attribute. > > * RFC: https://wiki.php.net/rfc/delayedtargetvalidation_attribute > * Implementation: https://github.com/php/php

Re: [PHP-DEV] [RFC] RFC Discussion - CLI-Only Development Mode and AOT Compilation Architecture

2025-06-16 Thread Rob Landers
On Mon, Jun 16, 2025, at 09:05, wheakerd wrote: > Dear PHP Internals, > > I am submitting this proposal for discussion regarding a potential future > direction for PHP: moving toward a CLI-only development model and introducing > an optional Ahead-of-Time (AOT) compilation infrastructure. > >

Re: [PHP-DEV] How hard would it be to add a "superyield" keyword?

2025-06-16 Thread Rob Landers
On Mon, Jun 16, 2025, at 20:10, Larry Garfield wrote: > On Mon, Jun 16, 2025, at 10:18 AM, Olle Härstedt wrote: > > Hello Internals, > > > > I was pondering a little about effect handlers today, and how they could > > work as a replacement for dependency injection and mocking. Let me show an > >

Re: [PHP-DEV] How hard would it be to add a "superyield" keyword?

2025-06-16 Thread Rob Landers
On Mon, Jun 16, 2025, at 17:18, Olle Härstedt wrote: > Hello Internals, > > I was pondering a little about effect handlers today, and how they could > work as a replacement for dependency injection and mocking. Let me show an > example: > > > require_once("vendor/autoload.php"); > > use Lati

Re: [PHP-DEV] Year 2038 issue

2025-06-16 Thread Rob Landers
On Mon, Jun 16, 2025, at 16:54, Alexandru Pătrănescu wrote: > > On Mon, Jun 16, 2025 at 4:03 PM Marc Bennewitz wrote: >> Hi all, >> >> It's 12.5 years only until the timestamps in PHP on 32bit will not work >> as expected anymore. >> > > Hi, > > I think that maybe we can already deprecate

Re: [PHP-DEV] [VOTE] Clone with v2

2025-06-11 Thread Rob Landers
On Wed, Jun 11, 2025, at 17:34, Tim Düsterhus wrote: > Hi > > Am 2025-06-08 21:15, schrieb Rob Landers: > > So, it seems like this can only be used for things that can already be > > cloned? > > Yes. It's an extension of the existing cloning functionality.

Re: [PHP-DEV] Feature Discussion |

2025-06-10 Thread Rob Landers
On Wed, Jun 11, 2025, at 08:31, Dmitry Derepko wrote: > I see. > > The first thought is about extending the class definition: along with > functions hashtable we would add virtual functions HT and lookup for the > function will be another HT lookup. > > image.png > > That for sure is better th

Re: [PHP-DEV] Feature Discussion |

2025-06-10 Thread Rob Landers
On Tue, Jun 10, 2025, at 22:09, Larry Garfield wrote: > On Tue, Jun 10, 2025, at 2:45 PM, Dmitry Derepko wrote: > > Thanks for participating, Larry. > > > > On Mon, Jun 9, 2025 at 10:29 PM Larry Garfield > > wrote: > >> 2. Please link to a PR of your actual implementation. In context it looks >

Re: [PHP-DEV] [VOTE] Clone with v2

2025-06-08 Thread Rob Landers
On Wed, Jun 4, 2025, at 17:13, Volker Dusch wrote: > Hi everyone, > > We just opened the vote for the "Clone with v2" RFC: > > RFC: https://wiki.php.net/rfc/clone_with_v2 > Discussion: https://externals.io/message/127353 > PR: https://github.com/php/php-src/pull/18747 > > As with every RFC, a 2/

[PHP-DEV] static properties in readonly classes

2025-06-08 Thread Rob Landers
Hello internals, As far as I can tell from previous conversations and PRs; static properties aren’t supported in readonly classes for technical reasons and because nobody was sure what to do with them ... ... but that seems weird because you can also do something like this: https://3v4l.org/u

Re: [PHP-DEV] [RFC] Transform void into an alias for null

2025-06-04 Thread Rob Landers
On Mon, Jun 2, 2025, at 18:27, Gina P. Banyard wrote: > Hello internals, > > This is the second RFC out of a set of type system related RFCs I want to > propose for PHP 8.5. > > The objective is to fix a weird quirk of PHP's type system, where void lives > in its own type hierarchy. > This is

Re: [PHP-DEV][RFC] Deprecate type juggling to and from bool type within the function type juggling context

2025-06-03 Thread Rob Landers
On Tue, Jun 3, 2025, at 18:19, Gina P. Banyard wrote: > On Monday, 2 June 2025 at 22:05, Rob Landers wrote: >> No offense, but this feels like it was written by someone who doesn’t use >> non-strict mode very often. > > As yes, saying this to me, someone that is known

Re: [PHP-DEV][RFC] Deprecate type juggling to and from bool type within the function type juggling context

2025-06-02 Thread Rob Landers
On Mon, Jun 2, 2025, at 18:11, Gina P. Banyard wrote: > Hello internals, > > This is the first RFC out of a set of type system related RFCs I want to > propose for PHP 8.5. > It also used the recently enabled Markdown support on the wiki, so there > might be a few oddities. > > The RFC propos

Re: [PHP-DEV] Module or Class Visibility, Season 2

2025-06-01 Thread Rob Landers
On Sun, Jun 1, 2025, at 09:17, Rob Landers wrote: > > > On Sun, Jun 1, 2025, at 07:26, Michael Morris wrote: >> Ok, the conversation is getting sidetracked, but I think some progress is >> being made. >> >> I started this latest iteration last yea

Re: [PHP-DEV] Module or Class Visibility, Season 2

2025-06-01 Thread Rob Landers
On Sun, Jun 1, 2025, at 07:26, Michael Morris wrote: > Ok, the conversation is getting sidetracked, but I think some progress is > being made. > > I started this latest iteration last year with a thread about introducing > something similar to the ES module system of JavaScript to PHP. What at

Re: [PHP-DEV] Module or Class Visibility, Season 2

2025-05-30 Thread Rob Landers
On Mon, May 26, 2025, at 21:39, Alwin Garside wrote: > Hey all, > > It took me a while, but I'm finally caught up with this thread, and would > like to give my 2 cents. > > On 25 May 2025, at 23:17, Rowan Tommins [IMSoP] wrote: > > > > On 25/05/2025 21:28, Larry Garfield wrote: > >> Even if

Re: [PHP-DEV] [RFC] Add num_available_processors

2025-05-25 Thread Rob Landers
On Sun, May 25, 2025, at 12:07, Alwin Garside wrote: > On 24 May 2025, at 20:48, Rob Landers wrote: > > > > On Sat, May 24, 2025, at 19:37, Daniel Kesselberg wrote: > >> > >> > >> Hi everyone, > >> > >> I'm happy to share my f

Re: [PHP-DEV] Module or Class Visibility, Season 2

2025-05-25 Thread Rob Landers
On Sat, May 24, 2025, at 23:18, Rowan Tommins [IMSoP] wrote: > On 24 May 2025 14:11:57 BST, Rob Landers wrote: > >My only concern is how this would be handled in the class tables. Right now, > >\AlicesCalendar\Monolog\Logger and \BobsDocs\Monolog\Logger would be > >consider

Re: [PHP-DEV] [RFC] Add num_available_processors

2025-05-24 Thread Rob Landers
On Sat, May 24, 2025, at 22:28, Niels Dossche wrote: > On 24/05/2025 21:24, Rob Landers wrote: > > > > > > On Sat, May 24, 2025, at 19:42, Niels Dossche wrote: > >> Hi > >> > >> In my opinion, the return type should not be nullable. >

Re: [PHP-DEV] [RFC] Add num_available_processors

2025-05-24 Thread Rob Landers
On Sat, May 24, 2025, at 19:42, Niels Dossche wrote: > Hi > > In my opinion, the return type should not be nullable. > Returning NULL when the platform (or PHP on that platform) doesn't support > getting this information is an anti-pattern. > Instead, availability of the necessary functionality

Re: [PHP-DEV] [RFC] Add num_available_processors

2025-05-24 Thread Rob Landers
On Sat, May 24, 2025, at 19:37, Daniel Kesselberg wrote: > Hi everyone, > > I'm happy to share my first RFC :) It proposes adding a small function > to retrieve the number of available processors; a feature that's > commonly found in other programming languages and one that I believe > would be

Re: [PHP-DEV] Module or Class Visibility, Season 2

2025-05-24 Thread Rob Landers
On Sat, May 24, 2025, at 11:34, Rowan Tommins [IMSoP] wrote: > > > Hi Michael, > > I'm going to skip over all the details about the autoloader for now, because > I think they're going deep into implementation details, and I want to focus > on the same top-level design as my previous email. >

Re: [PHP-DEV] [RFC] Readonly constructors

2025-05-22 Thread Rob Landers
On Thu, May 22, 2025, at 17:01, Mihail Liahimov wrote: > In PHP 8.1 the class read-on syntax was added, which allows you to create > classes that are completely closed to changes. In addition, it allows you to > write less boilerplate when declaring a property in the constructor. > > Before 8.1:

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

2025-05-18 Thread Rob Landers
On Sat, May 3, 2025, at 13:19, Rob Landers wrote: > Hello Internals, > > I've opened the vote for nested classes > https://wiki.php.net/rfc/short-and-inner-classes. Voting ends in a little > over two weeks: May 17, at 23:59:59 UTC. > > — Rob Hello Internals, The

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

2025-05-16 Thread Rob Landers
On Thu, May 15, 2025, at 22:11, Larry Garfield wrote: > On Thu, May 15, 2025, at 2:56 PM, Rob Landers wrote: > > On Thu, May 15, 2025, at 17:32, Tim Düsterhus wrote: > >> Hi > >> > >> Am 2025-05-15 14:14, schrieb Rob Landers: > >> > For example, if

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

2025-05-15 Thread Rob Landers
On Thu, May 15, 2025, at 17:32, Tim Düsterhus wrote: > Hi > > Am 2025-05-15 14:14, schrieb Rob Landers: > > For example, if you have a Money type, you'd want to be able to ensure > > it cannot be negative when updating via `with()`. This is super > > important

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

2025-05-15 Thread Rob Landers
On Thu, May 15, 2025, at 13:56, Stephen Reay wrote: > > > > > On 15 May 2025, at 16:44, Andreas Hennings wrote: > > > > On Thu, 15 May 2025 at 08:24, Stephen Reay > > wrote: > > [..] > >> > >> > >> I may be missing something here.. > >> > >> So far the issues are "how do we deal with a p

Re: [PHP-DEV] Module or Class Visibility, Season 2

2025-05-15 Thread Rob Landers
On Thu, May 15, 2025, at 10:35, Rob Landers wrote: > On Thu, May 15, 2025, at 10:11, Rowan Tommins [IMSoP] wrote: >> >> >> On 14 May 2025 22:27:32 BST, Rob Landers wrote: >> > >> >As written, that simply isn't possible in PHP because there is o

Re: [PHP-DEV] Module or Class Visibility, Season 2

2025-05-15 Thread Rob Landers
On Thu, May 15, 2025, at 10:11, Rowan Tommins [IMSoP] wrote: > > > On 14 May 2025 22:27:32 BST, Rob Landers wrote: > > > >As written, that simply isn't possible in PHP because there is only one > >class allowed with a given name. Names of classes are global.

Re: [PHP-DEV] Module or Class Visibility, Season 2

2025-05-14 Thread Rob Landers
On Wed, May 14, 2025, at 16:57, Rowan Tommins [IMSoP] wrote: > > > On 14 May 2025 14:24:57 BST, Michael Morris wrote: > >Well, it's what Go calls "modules". It's confusing because I was being > >truthful, not snarky, when I said "Ask 10 programmers for the definition of > >module and expect 12

Re: [PHP-DEV] Module or Class Visibility, Season 2

2025-05-14 Thread Rob Landers
On Wed, May 14, 2025, at 15:24, Michael Morris wrote: > > > On Wed, May 14, 2025 at 4:08 AM Rowan Tommins [IMSoP] > wrote: >> __ >> >> What Michael Morris is talking about is really a completely different >> concept - it's more like "containers", in the sense of Docker, Kubernetes, >> etc, w

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

2025-05-06 Thread Rob Landers
On Sun, May 4, 2025, at 15:52, Tim Düsterhus wrote: > Hi > > On 4/30/25 12:51, Rowan Tommins [IMSoP] wrote: > > I think you are insisting on a different definition of "private" for nested > > classes than exists anywhere else in the language, and one that I've not > > seen evidence of in any oth

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

2025-05-03 Thread Rob Landers
Hello Internals, I've opened the vote for nested classes https://wiki.php.net/rfc/short-and-inner-classes. Voting ends in a little over two weeks: May 17, at 23:59:59 UTC. — Rob

Re: [PHP-DEV] Deferred backtrace generation algorithm.

2025-05-02 Thread Rob Landers
On Fri, May 2, 2025, at 10:14, Edmond Dantes wrote: > Good day, everyone. > > In the neighboring thread Concept: Lightweight error channels, the > topic of exception performance was discussed. > > The main issue is the immediate backtrace generation in the > constructor, which can cause up to a 5

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

2025-04-27 Thread Rob Landers
On Sun, Apr 27, 2025, at 22:40, Kamil Tekiela wrote: > >The exception message MUST NOT be the only property that allows to > differentiate different types of error that the user may be interested in. > > What does this mean exactly? Can you give an example? > Many people don’t know about the $

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

2025-04-27 Thread Rob Landers
On Sun, Apr 27, 2025, at 20:06, Larry Garfield wrote: > I'm going to respond to points raised by several people together; I'm using > Ed's message as a starting point but this is also i response to Niels, Rob, > and Andreas. > > On Sun, Apr 27, 2025, at 3:16 AM, Edmond Dantes wrote: > > Good a

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

2025-04-27 Thread Rob Landers
On Sun, Apr 27, 2025, at 10:16, Edmond Dantes wrote: > Good afternoon, Larry. > > Looking at the comparison table, it seems that the two most important > differences are: > > 1. Backtrace consumes a lot of resources. > > 2. There is an explicit contract for exceptions thrown by a function. >

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

2025-04-26 Thread Rob Landers
On Sat, Apr 26, 2025, at 09:17, Larry Garfield wrote: > Hi folks. In several recent RFCs and related discussion, the question of > error handling has come up. Specifically, the problem is: > > * "return null" conflicts with "but sometimes null is a real value" (the > validity of that positio

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

2025-04-24 Thread Rob Landers
On Thu, Apr 24, 2025, at 17:20, Tim Düsterhus wrote: > Hi > > On 4/24/25 17:09, Rob Landers wrote: > > Thank you for your feedback! I think you would then have the problem that > > was pointed out by Levi the other day; where you would then have ambiguity. > > If

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

2025-04-24 Thread Rob Landers
On Thu, Apr 24, 2025, at 16:31, Tim Düsterhus wrote: > Hi > > On 4/20/25 15:43, Rob Landers wrote: > > As it seems that discussion has mostly died down, I'd like to put this > > towards a vote starting on May 1, 2025. > > Unfortunately I did not have the tim

Re: [PHP-DEV] Re: RFC: Nested Classes (was: short and inner classes)

2025-04-22 Thread Rob Landers
On Tue, Apr 22, 2025, at 19:22, Levi Morrison wrote: > On Sun, Apr 20, 2025 at 7:46 AM Rob Landers wrote: > > > > On Mon, Mar 31, 2025, at 21:45, Rob Landers wrote: > > > > Hello internals, > > > > I have significantly revamped the RFC (again). Key changes

[PHP-DEV] Re: RFC: Nested Classes (was: short and inner classes)

2025-04-20 Thread Rob Landers
On Mon, Mar 31, 2025, at 21:45, Rob Landers wrote: > Hello internals, > > I have significantly revamped the RFC (again). Key changes to the RFC: > > 1. More (realistic) examples, > 2. Since enums are basically specialized classes, they are allowed to be > nested as well (ha

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

2025-04-09 Thread Rob Landers
On Wed, Apr 9, 2025, at 01:29, Ilija Tovilo wrote: > 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 int

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

2025-04-08 Thread Rob Landers
On Tue, Apr 8, 2025, at 10:53, Daikaras wrote: > On 4/5/2025 6:51 PM, 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 > > > -1 because returning `n

Re: [PHP-DEV] RFC: blank() Function as a Complement to empty()

2025-04-05 Thread Rob Landers
On Sat, Apr 5, 2025, at 14:15, Kayck Matias wrote: > *INTRODUCTION* > This RFC proposes the addition of a new global function `blank()` to PHP’s > core, intended to provide a more intuitive and context-sensitive way of > checking for "blank" values. This function is *not a replacement* for > `em

Re: [PHP-DEV] RFC: blank() Function as a Complement to empty()

2025-04-05 Thread Rob Landers
On Sat, Apr 5, 2025, at 21:23, Bilge wrote: > On 05/04/2025 20:18, Rob Landers wrote: >> On Sat, Apr 5, 2025, at 21:10, Bilge wrote: >>> On 05/04/2025 19:41, Rob Landers wrote: >>>> empty() has very many uses. >>> That is exactly the same as saying `==` ha

Re: [PHP-DEV] RFC: blank() Function as a Complement to empty()

2025-04-05 Thread Rob Landers
On Sat, Apr 5, 2025, at 21:10, Bilge wrote: > On 05/04/2025 19:41, Rob Landers wrote: >> empty() has very many uses. > That is exactly the same as saying `==` has many uses. It does. So many uses > that it's useless. Its semantics are nonsense. >> >> if (isset($va

Re: [PHP-DEV] RFC: blank() Function as a Complement to empty()

2025-04-05 Thread Rob Landers
On Sat, Apr 5, 2025, at 20:25, Bilge wrote: > On 05/04/2025 15:32, Kamil Tekiela wrote: > > > > While it has its uses empty() should be avoided whenever possible. > > > Agree. A better RFC would be to just deprecate `empty()`. > > Cheers, > Bilge > empty() has very many uses. Once you understand

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

2025-04-05 Thread Rob Landers
On Wed, Mar 19, 2025, at 21:09, Bob Weinand wrote: > > > On 19.3.2025 16:04:06, Rob Landers wrote: >> On Tue, Mar 18, 2025, at 03:37, Bob Weinand wrote: >>> Okay, I see the point with LSP. I'm not sure whether we need to preserve >>> LSP for that specifi

Re: [PHP-DEV] RFC: Nested Classes (was: short and inner classes)

2025-04-05 Thread Rob Landers
On Wed, Apr 2, 2025, at 07:54, Viktor Khramov wrote: > Hi Rob. > The examples in this RFC only describe usage within classes as far as I can > see. > Does this finally solve the factory methods issue? > https://externals.io/message/126452 > > пн, 31 мар. 2025 г.

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

2025-04-05 Thread Rob Landers
all; everyone reading it knows you mean "*this* particular class's Items" and they don't have to search the class to see if it is inherited or not. On Sun, Mar 23, 2025, at 16:17, Larry Garfield wrote: > On Wed, Mar 12, 2025, at 5:10 AM, Rob Landers wrote: > &g

Re: [PHP-DEV] [RFC brainstorm] Approximately equals operator

2025-04-01 Thread Rob Landers
On Tue, Apr 1, 2025, at 22:17, Derick Rethans wrote: > On 1 April 2025 20:52:32 BST, Larry Garfield wrote: > >On Mon, Mar 31, 2025, at 5:03 PM, Niels Dossche wrote: > >> Hi internals! > >> > >> I'm excited to share what I've been working on! > >> I had an epiphany. I realized what we truly need to

Re: [PHP-DEV] [RFC brainstorm] Approximately equals operator

2025-04-01 Thread Rob Landers
On Tue, Apr 1, 2025, at 15:06, Iliya Miroslavov Iliev wrote: > Claude, in your example if `var_dump(false == true);` is `false` what is > `true` in this world? It is `true` that `false` is not `true`. > > On Tue, Apr 1, 2025 at 3:39 PM Claude Pache wrote: >> >> >>> Le 1 avr. 2025 à 00:03, Nie

Re: [PHP-DEV] RFC: Nested Classes (was: short and inner classes)

2025-03-31 Thread Rob Landers
On Mon, Mar 31, 2025, at 21:45, Rob Landers wrote: > Hello internals, > > I have significantly revamped the RFC (again). Key changes to the RFC: > > 1. More (realistic) examples, > 2. Since enums are basically specialized classes, they are allowed to be > nested as well (ha

[PHP-DEV] RFC: Nested Classes (was: short and inner classes)

2025-03-31 Thread Rob Landers
Hello internals, I have significantly revamped the RFC (again). Key changes to the RFC: 1. More (realistic) examples, 2. Since enums are basically specialized classes, they are allowed to be nested as well (hat tip to Reddit), 3. Using backslash as the class separator, 4. Proper scoping (and sha

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

2025-03-25 Thread Rob Landers
On Tue, Mar 25, 2025, at 23:20, Rowan Tommins [IMSoP] wrote: > > > On 25 March 2025 21:23:48 GMT, Rob Landers wrote: > > > >> If we didn't have "protected", would you ask the same about "protected > >> private"? "fileprivate

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

2025-03-25 Thread Rob Landers
On Tue, Mar 25, 2025, at 22:05, Rowan Tommins [IMSoP] wrote: > > > On 25 March 2025 20:29:16 GMT, Rob Landers wrote: > > Personally, I'd feel that file-private should be kept as simple as possible > > and limit it to "top-level" things, but that doesn&#x

  1   2   3   4   5   >