Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:108405 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 81925 invoked from network); 5 Feb 2020 14:03:39 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 5 Feb 2020 14:03:39 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 3A2B21804D1 for ; Wed, 5 Feb 2020 04:16:04 -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,RCVD_IN_MSPIKE_H2,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-lf1-f53.google.com (mail-lf1-f53.google.com [209.85.167.53]) (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 ; Wed, 5 Feb 2020 04:16:03 -0800 (PST) Received: by mail-lf1-f53.google.com with SMTP id b15so1328341lfc.4 for ; Wed, 05 Feb 2020 04:16:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=qIyhliYwKsM8KBvc7p6/uUZtXUjoUEUMHCjip3qTDk8=; b=NgcVERZDTvKcfX02YPb9prXnLoM6ZsR7rTA6ifMAi7GXGPsBt0DUvL1A3DhZkXnUXm 4vJm7V4GJ6mlcZmLE4JB/bgk9OpiXQY3FUKvL2M1dzGTXpbmSG75KI0xw1aS6rBS8WBO ZwJUWtkJvOPzcH1kjaBOA9AbQopJw1lWVIw8bM3SitmrNu4aAJA85wmBFDjq3rVbfJMk xg9u8Io2LkFbo7eX0Okc+U2RvLErdFwZcB8quk/yVF2CE/4AJiU1q3Fh0qaUqEgNnrEr mQ67czwaiypQHuy8AQWrhjIlhSUI7fctp9PnDrWWdT1T7v2IgmolBMBSeA5eGz/j/5J0 RiWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=qIyhliYwKsM8KBvc7p6/uUZtXUjoUEUMHCjip3qTDk8=; b=kBO8CcIylk8Ijccq1KAqmPF/CMCEA3lXyGH69OBzjR4/QPdj/sk3In3cxGFvFWGLgr PGmZ8p+nuMymMKhIdyvbgJ0INNP1HSf45yVmAjNsHMuE0bK6e5f3wShLjmtBA0LZTr2g 5WpQRLfr9uZr5T2xx2husnyuaFCoCfkYPLmJUgwdtKKvaNn21aOF0S/b612T83mLlqKe Tpr3SZZ/M87cHPQDi3yN7SwGSmti5TP3lXfONLvp7AaxDaWRgYRJrk9kD+N3G9YOlgZL ZWsO7irQDurDZADDnNO/PRSLMMP7ZNAmJbB5SpGg2T4njqb0jgXIO3PPfCpEslFB8vrJ Y+LQ== X-Gm-Message-State: APjAAAUn7frlmXkHAtEJsKGl/q0D4Lwr7O88L0yyD6E3Haic9JW+8yzt bmDOGzmpFOg1IGcnRCcLgLT276L1nSibGkjTSQ== X-Google-Smtp-Source: APXvYqwi9TnGtk+RFawABwjkAeOdD1MBf7efmaTPlzNLNk0yK3zfbN3CTS9QP2EOsJ3CATdmAoYWMxSEpwogtp90ryo= X-Received: by 2002:ac2:4849:: with SMTP id 9mr17526628lfy.11.1580904957707; Wed, 05 Feb 2020 04:15:57 -0800 (PST) MIME-Version: 1.0 Received: by 2002:ab3:1904:0:0:0:0:0 with HTTP; Wed, 5 Feb 2020 04:15:56 -0800 (PST) In-Reply-To: References: <5e24c6ec.1c69fb81.1d93b.aafcSMTPIN_ADDED_MISSING@mx.google.com> Date: Wed, 5 Feb 2020 13:15:56 +0100 Message-ID: To: Nikita Popov Cc: Andrea Faulds , PHP internals Content-Type: multipart/alternative; boundary="0000000000006d8899059dd31e9a" Subject: Re: [PHP-DEV] Warn when declaring required parameter after optional one From: guilliam.xavier@gmail.com (Guilliam Xavier) --0000000000006d8899059dd31e9a Content-Type: text/plain; charset="UTF-8" Hi, On Wednesday, February 5, 2020, Nikita Popov wrote: > > > I like this idea and have updated the pull request to ignore the "Type > $param = null" case, so the deprecation should now just catch the > "definitely" incorrect signatures. > > So to summarize the current state: > > function test($foo = "bar", $baz) {} > // Deprecated: Required parameter $baz follows optional parameter $foo > > function test(Abc $foo = null, $baz) {} > // No warnings, works fine! > > With that adjustment made, are there any further concerns about this > change? Can you please just clarify which of the following will emit a deprecation? function f1($a = null, $b) {} function f2(A $a = null, $b) {} function f3(?A $a = null, $b) {} (I think f1 will, f2 won't, but f3?) Thanks > > Regards, > Nikita > -- Guilliam Xavier --0000000000006d8899059dd31e9a--