Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:69182 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 38807 invoked from network); 18 Sep 2013 10:30:04 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Sep 2013 10:30:04 -0000 Authentication-Results: pb1.pair.com smtp.mail=nikita.ppv@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=nikita.ppv@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.214.180 as permitted sender) X-PHP-List-Original-Sender: nikita.ppv@gmail.com X-Host-Fingerprint: 209.85.214.180 mail-ob0-f180.google.com Received: from [209.85.214.180] ([209.85.214.180:33779] helo=mail-ob0-f180.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F3/F4-13799-BA089325 for ; Wed, 18 Sep 2013 06:30:04 -0400 Received: by mail-ob0-f180.google.com with SMTP id wm4so6884014obc.25 for ; Wed, 18 Sep 2013 03:30:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=TCHit52dGIUUai2rBDVa8DVO4SIwSNDpMugUlogC4jw=; b=wVVrduqG50BBjQu/j84+dgK2zYFl9UtuJmczwzUDHqSkuBnAn8iOXk4ANg/p0Hd6K2 VOGDuSk7T37Qn3L4UADuU/KOmZMvlkiBftN1MpgjX/stMUnIH5/UolNgG2DUC50rMoy2 Gz7H+JSk9YE0G/pA90DVzPqIlaZ7y8luu8P9KtWyWt1lQTb9Wl7vVPW+hFXiijcRLCoA CTTEO8fyuNwg/i7vf+ISi3bgfeunxa4k1HfZ3sGel1/M8weL78kh8LA9CrU2pTjXGYqN BmCaUeXxpdqW7k2xilEvb6ur5IC9rkGa4yxE4QGWqTpeESw6o9YD0BpJyiaxyvxWET90 dJLQ== MIME-Version: 1.0 X-Received: by 10.60.60.5 with SMTP id d5mr34300311oer.0.1379500201107; Wed, 18 Sep 2013 03:30:01 -0700 (PDT) Received: by 10.182.98.8 with HTTP; Wed, 18 Sep 2013 03:30:01 -0700 (PDT) In-Reply-To: References: Date: Wed, 18 Sep 2013 12:30:01 +0200 Message-ID: To: PHP internals Content-Type: multipart/alternative; boundary=089e0149c3c074b29904e6a5eb90 Subject: Re: Signature compatibility: Number of arguments From: nikita.ppv@gmail.com (Nikita Popov) --089e0149c3c074b29904e6a5eb90 Content-Type: text/plain; charset=ISO-8859-1 On Thu, Aug 29, 2013 at 11:33 AM, Nikita Popov wrote: > Hi internals! > > This is a spinoff from the variadics thread. Quoting Stas: > > > I also think this: > > public function query($query, ...$params) > > public function query(...$params) > > should be legal too. > > This is a general issue in PHP that we might want to fix: Currently a > method A is not compatible with a method B if A has less arguments than B. > > E.g. both of the following are incompatible signatures: > > public function foo($bar) > public function foo() > > public function foo($bar = NULL) > public function foo() > > This doesn't really make sense. Removing parameters doesn't violate LSP, > because in PHP it is legal to pass more arguments than declared. (Only > adding additional required parameters would violate LSP.) > > Is it okay to change this? > > Thanks, > Nikita > Considering that we might support named parameters in the future I'm withdrawing this suggestion. This allows removing a parameter name, which would cause problems in that context. Nikita --089e0149c3c074b29904e6a5eb90--