Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:112121 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 15726 invoked from network); 26 Oct 2020 13:53:45 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 26 Oct 2020 13:53:45 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 040C81804B5 for ; Mon, 26 Oct 2020 06:12:10 -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=-1.9 required=5.0 tests=BAYES_00,HTML_MESSAGE, SPF_HELO_NONE,SPF_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-mahalux.mvorisek.com (mail-mahalux.mvorisek.com [77.93.195.127]) (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 ; Mon, 26 Oct 2020 06:12:08 -0700 (PDT) Received: from 511305167314 (10.228.0.188) by mail-mahalux.mvorisek.com (10.228.0.4) with Microsoft SMTP Server (TLS); Mon, 26 Oct 2020 14:12:06 +0100 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="=_b185c9d8304f706f757cf5db679951d8" Date: Mon, 26 Oct 2020 14:12:05 +0100 To: PHP internals Message-ID: X-Mailer: SAP NetWeaver 7.03 Subject: Bug #80248 - Swapping parameter names during inheritance does not throw From: vorismi3@fel.cvut.cz (=?UTF-8?Q?Michael_Vo=C5=99=C3=AD=C5=A1ek_-_=C4=8CVUT_FEL?=) --=_b185c9d8304f706f757cf5db679951d8 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8; format=flowed Hi, I am writing regarding bug 80248. Currently, PHP 8 allows parameter reuse at different position, which I belive is very dangerous, as passed parameters may be passed in a different order with different object impl. See https://3v4l.org/X8omS , which is against OOP and LSP. I belive, we can allow parameter rename, but we should throw if "already seen parameter name is at a different position". I am not that good in C to fix this, so only reporting. I belive, we should fix this issue asap and merge into PHP 8. Also - for further discussion - I think, we can even allow parameter rename, but still allow to use the old name (which, with fix above, will always result to the same param position). Example: https://3v4l.org/kgHWf (now an error, it violates OOP/LSP again) With kind regards / Mit freundlichen Grüßen / S přátelským pozdravem, Michael Voříšek --=_b185c9d8304f706f757cf5db679951d8--