Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:108185 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 30397 invoked from network); 17 Jan 2020 20:02:50 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 17 Jan 2020 20:02:50 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 3CEBB18053E for ; Fri, 17 Jan 2020 10:10:30 -0800 (PST) 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,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-lj1-f180.google.com (mail-lj1-f180.google.com [209.85.208.180]) (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, 17 Jan 2020 10:10:29 -0800 (PST) Received: by mail-lj1-f180.google.com with SMTP id j26so27352670ljc.12 for ; Fri, 17 Jan 2020 10:10:29 -0800 (PST) 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=Jbmk+HbAZ2BUdmeYBJB1aRhxNH4xz+CvdnI/PTc/hfM=; b=bThAvrv+CNASC9lUNto504UPthOWp8oBVr5UthrVqpVKydneFKAQ7dXeuCe0V9pqSs n+KbtqhkC3diFCj5yx1X4V6yrXp99N0rKYo4+3xR6Gy+Hy1+igjaWGrv5EWpGJ8xfdx7 BsOgZpE85hAtuuE6XKbkhpfrrR2JlrSziPGtU8o4/f4EKIs2HB6A8G3zrnqsddZA+tvA dPafHyyTa76++9wvqJYA3mosMr0Q0lI7cuGLrMjHEQtba5juHbhHJHfO1gR7h2QDiCVT Yj6Qr1LsHJes7eYllThDKZ1Hz/dVdz6L89OYuoCmcbgYI9kLofJZgMqATzJ5/c8xPCUW i5fA== 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=Jbmk+HbAZ2BUdmeYBJB1aRhxNH4xz+CvdnI/PTc/hfM=; b=UQzrnxOLVWddUt1IellMYJT0D4fxks/BNEWDSiTyb3iiw1DkkhcfpIjTeEpUzCkml7 NqqBaK9fEftaQxpdHuM2Od1Su7uhL2/pm/nECZMiPQZV/ua+cGQ+24qa2ZgyMwQSIMsL kFfQajKAvJ8laE+fDlvsjK6/LobyVApzQkEn5+1SBusN+D82BV4li4JCh8Ta7cmq2Lsd IXywxohBUYhCMV/pSzje9YHgxsWr0rT/LV1ulOssC7agwzkcEd0XXKCpRJtfuFxzED5M pDUmotJ/cTaplypOx4+rJjWnyYtyOXOEHGCItDBO6pYRgBnJmNX6tKgUnirEBZb+qiNO 2sAA== X-Gm-Message-State: APjAAAVjYJXuDFlA9DQ9cnmT9UUuYgc3coaQS2RS3dr5f+Y7eW0I1lpm lQ/71vzjf8gFA465+OFtgIx2MQf7UQVCuxsEvX8= X-Google-Smtp-Source: APXvYqyrRCXBaLT4TJ/uk6jd4ADL8R5hqJ6CvZo59kC3+BcD0JYvhDGrWann0yh7bI5gF/oJzp4gUQLwa9Vv2ZoVmLQ= X-Received: by 2002:a2e:7009:: with SMTP id l9mr6293079ljc.96.1579284625148; Fri, 17 Jan 2020 10:10:25 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Date: Fri, 17 Jan 2020 18:10:13 +0000 Message-ID: To: Nikita Popov Cc: Niklas Keller , Bob Weinand , PHP internals Content-Type: multipart/alternative; boundary="00000000000014cf56059c59db12" Subject: Re: [PHP-DEV] Warn when declaring required parameter after optional one From: cdtreeks@gmail.com (Aran Reeks) --00000000000014cf56059c59db12 Content-Type: text/plain; charset="UTF-8" Hi all, Whilst I totally see the benefits of this, I'm not sure if this is a job for PHP itself, rather a coding standard enforced optionally by something like PHPCS. It's certainly a bad practice, but I'm not sure the benefit will be worth the refactors required. I feel we might be an interesting example, however, it'd cause us a lot of pain for the following reason: We have a portion of our codebase (shared over hundreds of websites) which is symlinked into each of the websites so the core functionality can be easily updated when required on all sites. These sites are staggered at present across multiple PHP versions whilst being migrated (and due to the number of sites to migrate, they will be for some time). If this change were to come into effect, the same code we've safely had symlinked running across multiple PHP versions would suddenly become incompatible on the latest version, with no easy way to be suppressed which would mean we have to fork things and maintain two codebases. I appreciate this isn't likely to be a normal workflow for people, but it is an example of how it could cause unintended pain. Just my thoughts anyway. Cheers, Aran On Fri, 17 Jan 2020 at 18:00, Nikita Popov wrote: > On Sat, Jan 11, 2020 at 2:35 PM Niklas Keller wrote: > > > Hi Nikita, > > > > while this is a rather small change, it has quite some BC impact, as > > not all old code has been adjusted to run on PHP 7.1+ only using > > nullable types. > > > > I'd like to see an RFC with a vote for this. > > > > Regards, > > Niklas > > > > I was interested in seeing how prevalent this pattern, is, so I ran some > analysis on the top 2k composer packages. I found 527 signatures that would > throw a deprecation warning with this change. Of these 187 are potentially > used as "poor man's nullable types" (the optional argument has both a type > and a null default), while the other 340 are definite bugs. > > Regards, > Nikita > --00000000000014cf56059c59db12--