Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:110991 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 36915 invoked from network); 14 Jul 2020 09:18:27 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 14 Jul 2020 09:18:27 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 0E07A1804D2 for ; Tue, 14 Jul 2020 01:10:50 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-io1-f51.google.com (mail-io1-f51.google.com [209.85.166.51]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 14 Jul 2020 01:10:49 -0700 (PDT) Received: by mail-io1-f51.google.com with SMTP id d18so16402521ion.0 for ; Tue, 14 Jul 2020 01:10:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=+lnDDCRz7lyqAWJEbU/zUZo2CnZhGVxxNxn1ZJod20E=; b=PaNOxC+lv3jEMgcgQV5O4pzh9VEXeL9O4PU3mCZtFVWW77f1W9WkRtEw6evx1UoCIh 7L4OeFex8NZKBP7f+HyTGkJJLMMb/9COPvujEJUvCR1P8p5SH3JrmxIpZjsnfjsBvxPo VPVfMQGOyJ4MdWZdvwrTwjdboJIo9UxWurayam3zS+lRgcNaQ4NP53HC5MYc1L/jbxoN C8hs2MBHwoTDh/qepS0RjUKZr01/nt8yVy8Uc1ozE8tQ8pnWnx1GowHs1lHuxc+3SzRR rS9GZkZR9M/gGf6mlKHAc8c8FcPV2heP7TlJzWwvoaIqozpRIkniC9FbsDXpgRy2E0xM +RxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=+lnDDCRz7lyqAWJEbU/zUZo2CnZhGVxxNxn1ZJod20E=; b=sJnISJwI/drm5GO5G95YoKkzJ2sWIyGbd14sUrs8IktYZWOauExuqFzziSinl53lNs 1pRaILrarIwiKCyKV+1SWXNVRKB/QqJpY5gsVXYHgrOMYuBcBJceJXTesVKdu8BsFppl FOjmdcvTArfwIotXxl98msb31M93zHZgywOCARmzVKq5aju6ErHKnTtjlviS5SE/Znr2 95PPcZFhQzmzOM9zaQVIl14Gvc5+uI/W4Y3X3yS71LmyYd8CbUnJ2YWudQLPbxuKHEdF 0h0zZjcCtxbkbYx9fQRw8KiUWcNg0FekDfl0lw9X8vHlw1LxD+/4MXroJs9QIrNO20WC h3Gg== X-Gm-Message-State: AOAM530RSwgIboIfgn2lOvOcLzzgIkBC6fJkdcxiJXTG2J3uCmIULbht QkiltPfrGOUJISISiIR70Zj1fhAlPYuvD2MOuY6k+A== X-Google-Smtp-Source: ABdhPJyvio5V8SM7P0cVR10uThYj32zOu8d3fd4uW0U/LTuLiF39aI6qAjJriFRextAi3AdkNgtdZUCLECnxXrireA4= X-Received: by 2002:a05:6638:d8b:: with SMTP id l11mr4459735jaj.124.1594714243538; Tue, 14 Jul 2020 01:10:43 -0700 (PDT) MIME-Version: 1.0 References: <1e39fdcb-16d2-42c3-95cf-507f7b647b50@www.fastmail.com> <3bfb89c5-c8fd-4587-8c1f-8b7bbbaca692@www.fastmail.com> In-Reply-To: Date: Tue, 14 Jul 2020 09:10:29 +0100 Message-ID: To: PHP internals Content-Type: multipart/alternative; boundary="00000000000001232a05aa625866" Subject: Re: [PHP-DEV] Possible RFC: UniqueInterface that throws exception at refcount > 1 From: rowan.collins@gmail.com (Rowan Tommins) --00000000000001232a05aa625866 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, 13 Jul 2020 at 22:32, Olle H=C3=A4rstedt w= rote: > 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, --=20 Rowan Tommins [IMSoP] --00000000000001232a05aa625866--