Re: Possible RFC: UniqueInterface that throws exception at refcount > 1

From: Date: Tue, 14 Jul 2020 08:10:29 +0000
Subject: Re: Possible RFC: UniqueInterface that throws exception at refcount > 1
References: 1 2 3 4 5 6 7  Groups: php.internals 
Request: Send a blank email to internals+get-110991@lists.php.net to get a copy of this message
On Mon, 13 Jul 2020 at 22:32, Olle Härstedt <olleharstedt@gmail.com> wrote: > In the end I need uniqueness (non-aliasing) to finish my series of > patches about typestate and type-safe builders to Psalm, but I guess I > can live without any runtime representation of this, or just suffer > the hack I already did with zval dump. > I think this kind of thing is probably best left to static analysis anyway. PHP ends up doing much more checking at run-time than most languages because it has no official static analyser, and no build step where static analysis can be mandatory. But in the end what you're trying to catch here is programmer mistakes, not unexpected run-time behaviour. Regards, -- Rowan Tommins [IMSoP]

« previous php.internals (#110991) next »