Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:110084 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 66437 invoked from network); 8 May 2020 12:41:23 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 8 May 2020 12:41:23 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 69E881804C2 for ; Fri, 8 May 2020 04:17:03 -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=-0.7 required=5.0 tests=BAYES_05,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-ej1-f50.google.com (mail-ej1-f50.google.com [209.85.218.50]) (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 ; Fri, 8 May 2020 04:17:02 -0700 (PDT) Received: by mail-ej1-f50.google.com with SMTP id re23so1010798ejb.4 for ; Fri, 08 May 2020 04:17:02 -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 :cc; bh=ZeOP2DQvR4JmV2M8XdbEIxeGrAoALbUnBJlzpzkJwIU=; b=CmfUZqZt9JX0bKJ6v80kzjoqCdQjyEWhbT62J6yPOPeOmqY/PYOykJXkHWaxBIWuhO 2xekXwE/El7QBj4FvJ10P+e2alBsl8d4cHGQ6qpruvgKTZTD+eSuXlSupipcY9xhafkn 15uDLu/rr5riuWlCbRNFYbdJfFDtXTRhm3XAK0frI5EKfCokyFzckCIevlAaBdO8snVY nbURO9SNcrNVwdQHOBvQwbLNPZEomoNZplRlh9gH8H5SjYG/vEuIdr9/F3jEyIzogzZF buwTylMqCSfflGIsj97w24d+cyYLMtxRAlyNbnB6vsWWgSeKQh+hpmErrqeAk73/G5jQ FmwA== 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:cc; bh=ZeOP2DQvR4JmV2M8XdbEIxeGrAoALbUnBJlzpzkJwIU=; b=cGf3gjz4zccu1pBKcXGGiXVK7ywM1Tc9aLRHWKlFBKS0T26XKlwH9J+My7gKtLk5gm exp0u4YAxtnBa7FzIReUH/MBTnkpJ36TdoQtvwcFgoqpFTaQSLiR9IofSjZSexyOvJMe LiIkVrwXVjPIH8jnfjkfZodIPcTI0hUujQotWm8jo2OLDnPbhqu2YTiYmVzKGrMMmwTB ZfKjM/GM1K/bsiVMM25zrYKc8DoVJ+CwMHZYCo5a2SpH8xeh0oeeX/XvUiLsSNLM2nT2 1DN8M9s+lsJZpDAdqwSpOMVXcjlZCYYHGhpKFOtTJjwQTJUbUzE6t3nyK+DDfGxsfFcr 3Tbw== X-Gm-Message-State: AGi0PuZVb85at99Vneo3Sj70pLsnPHMINAdVj87lTAP42VoOXmDr7dvX vCm8BVbEiGqMYTVP7M+j7nAIdSbC7aUbKPb7dI8= X-Google-Smtp-Source: APiQypJKwduFTSgeFEZQYy2aZ9QE/ukIH36G4elhDzPgjIqFeQg6Xj5r6fIuJRfkKlfTYYcsyiQrm2ASfiVUUBMLNzA= X-Received: by 2002:a17:906:4310:: with SMTP id j16mr1492834ejm.102.1588936619989; Fri, 08 May 2020 04:16:59 -0700 (PDT) MIME-Version: 1.0 References: <171dee3baf3.bef5753260554.3262181919550021853@manuelcanga.dev> In-Reply-To: Date: Fri, 8 May 2020 13:16:48 +0200 Message-ID: To: Thomas Gutbier Cc: Manuel Canga , Internals Content-Type: multipart/alternative; boundary="000000000000ce1eea05a52122d3" Subject: Re: [PHP-DEV] [RFC] Keep type of reference params From: george.banyard@gmail.com ("G. P. B.") --000000000000ce1eea05a52122d3 Content-Type: text/plain; charset="UTF-8" On Fri, 8 May 2020 at 13:04, Thomas Gutbier wrote: > Am 08.05.2020 um 12:37 schrieb G. P. B.: > > I think everyone can agree this is useful. But the issue here is the > > implementation. Because from what I know PHP's references are aspecial > > kind of pain in the engine. > > > > That's why the common wisdom is to use references in PHP as least as > possible. > > And IIRC what you are trying to achieve would need a major overhaul of > how > > references work and someone who wanted to tackle this would have done it > on > > their own and propose an RFC at the same time. > > > > So sadly unless something semi-concrete shows up, I'm considering this a > > pipe dream. > > But I'd gladly be shown otherwise. > > Isn't that already solved for typed properties? > > Consider this: > > class A { public static int $number = 5; } > $num = &A::$number; > $num = "String"; > > This will result in an uncaught TypeError, > see https://3v4l.org/XC6hk > > I would think, it would be consistent if referenced parameters > behaved in exactly the same way. > > Regards, > Thomas > Indeed, I forgot that typed references properties for classes were a thing now. It does make this way less of a pipe dream and something achievable, but I would imagine this not to be trivially implemented/extended to accommodate this. Moreover, although this is bad design IMHO, but some people may rely on this weird feature, which brings back the whole how to handle BC question. I for one, would be in favour of burning this into the ground but I don't know how others feel. Best regards George P. Banyard > --000000000000ce1eea05a52122d3--