Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:68679 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 1930 invoked from network); 29 Aug 2013 11:14:14 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Aug 2013 11:14:14 -0000 Authentication-Results: pb1.pair.com smtp.mail=patrick.allaert@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=patrick.allaert@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.219.54 as permitted sender) X-PHP-List-Original-Sender: patrick.allaert@gmail.com X-Host-Fingerprint: 209.85.219.54 mail-oa0-f54.google.com Received: from [209.85.219.54] ([209.85.219.54:41883] helo=mail-oa0-f54.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 74/62-23883-50D2F125 for ; Thu, 29 Aug 2013 07:14:13 -0400 Received: by mail-oa0-f54.google.com with SMTP id n10so258685oag.41 for ; Thu, 29 Aug 2013 04:14:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=mBYx0C8P6HdU7pzU6WW3XmSayVv9S/wnuS3UF6UZ4uk=; b=TINlURgWXKfKgcjvtGHldVRaiY+K2Ooiip4e7mX7YT9W/j0NOxri1sBELWKPVKkRXt P6kqSnHvhHL+jZjtb9nzUofaJFqTaTwYsJRccFnZNCt/Iy2NOZMMVF3WCrn7ytpMz/4K dNRsTG72a93akb3R7XQ2VmBz3UV+jqyuMcD3nF5uYrmpw7M4CCkPtBW+5m/+0lEQjESL VGag3uO15j6RAO69HP2c1zDVzDhcbaWbFpBAhDrjdxCNyeXtNMQlx3fbkzTb3povHIGh Tr+IwJeQFcEhb3+r//mHsYNRTLENi7PBJ3zKVrsiQqSoc2W7Urg6eY5DopJ0rN5WBaEh F/ew== MIME-Version: 1.0 X-Received: by 10.60.80.167 with SMTP id s7mr2087160oex.38.1377774851096; Thu, 29 Aug 2013 04:14:11 -0700 (PDT) Sender: patrick.allaert@gmail.com Received: by 10.76.173.34 with HTTP; Thu, 29 Aug 2013 04:14:11 -0700 (PDT) In-Reply-To: References: Date: Thu, 29 Aug 2013 13:14:11 +0200 X-Google-Sender-Auth: z7UcwwPAsZ5fAN0CNPeQigGASpE Message-ID: To: Nikita Popov Cc: PHP internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] Signature compatibility: Number of arguments From: patrickallaert@php.net (Patrick ALLAERT) 2013/8/29 Nikita Popov : > 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. I respectfully disagree. The first method requires at least one parameter (or two, depending on the pending clarification in the other thread) , and the latest: zero or more (or 1 or more). > 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? I see no reason to do so and I would say -0.5.