Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:110083 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 64024 invoked from network); 8 May 2020 12:28:23 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 8 May 2020 12:28:23 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 9E7791801FD for ; Fri, 8 May 2020 04:04: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=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS8972 80.67.16.0/20 X-Spam-Virus: No X-Envelope-From: Received: from smtprelay04.ispgateway.de (smtprelay04.ispgateway.de [80.67.18.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Fri, 8 May 2020 04:04:02 -0700 (PDT) Received: from [92.198.40.181] (helo=[192.168.1.37]) by smtprelay04.ispgateway.de with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.92.3) (envelope-from ) id 1jX0nQ-0006kF-Gj; Fri, 08 May 2020 13:04:00 +0200 To: "G. P. B." References: <171dee3baf3.bef5753260554.3262181919550021853@manuelcanga.dev> Cc: Manuel Canga , Internals Message-ID: Date: Fri, 8 May 2020 13:03:59 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: de-DE X-Df-Sender: dGhvbWFzLmd1dGJpZXJAYW50aHJvdGVjLmRl Subject: Re: [PHP-DEV] [RFC] Keep type of reference params From: thomas.gutbier@anthrotec.de (Thomas Gutbier) 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