Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:104118 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 66043 invoked from network); 4 Feb 2019 16:29:37 -0000 Received: from unknown (HELO mail-vk1-f174.google.com) (209.85.221.174) by pb1.pair.com with SMTP; 4 Feb 2019 16:29:37 -0000 Received: by mail-vk1-f174.google.com with SMTP id h128so3124430vkg.11 for ; Mon, 04 Feb 2019 05:10:31 -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=mMj8o+kXP7gsYvVPnziIHqFuya+/nUx+6WF+1nBCxg8=; b=o3e76hbsK0QfYpoYXT6l5/BnLDjO5FmH7u/3QDcMhtq/Sh11XFhVNo7WBWK9Bq7kjD HKXFAQXha4AhY2rgz4ZxsNUiBeYzkVClgxzKwh7EjJqJBXTeDCs4zLxMwLPZaFSYhvbW R5vlPIQn41U6dpb3U5WdMpEuyL4H8nd/E9BSsY6dzDz6eIw0Tf+kX7z53sLTcQYa+yJj NW4hgbLeLmp1UkeXRIMefTAqPPn6mSJaZOzrUbz+N1pM2QYuaw0KB32un/HBjHaOHyfL XrFHILLP5HMrL8VaBV4vBdFvH919aVububoSCelnuCRfnY3xxeDLPX8NlLkywC0cNi+1 HJ9A== 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=mMj8o+kXP7gsYvVPnziIHqFuya+/nUx+6WF+1nBCxg8=; b=rZ3GTUpQs7Np8S4QuRYxYtk6QgEIryLDWAIp/B0LuZyMYKqNIMwY+sZWOBEJaQ6C+n WYzcjo0QipZrtsSOfjuHFR4V8Rm7IfZHLq0didAKjpR09efiGS+zbpFFZS7gYuesiOvA 4C+AVEzmyWTPK6oTkZ7PboIMx2+wgaGxDIaiykbzi5xXbejhCLW4zOLmRYo3FXIAeWiS ZTSbn/WdW6+jKDmNcy8xtmBT5BhUFA9D12zazQHbRCjkI3K7Ibod9ncp7xWToJBZF+Z3 eObrzqj9JKd8eJR2Gmu/K8PplaV8O0EyFK/ui70r+v8bW8DhyoYRgPoe5SoPzjoMS+kV yNXQ== X-Gm-Message-State: AJcUukd4r7oVT5TfGu+hHZHaUZzc7gTDcx8D2belfevB8a+ZiVO0XDCx RMQ78paubWdCMEmpy21Hqqtz6YrXL5mlHhh6nto= X-Google-Smtp-Source: ALg8bN5cTbaiv+wvP6AQd9LZMy7vk1gGdY1UzwgO4WxaJe9bsREJF44SeULN7K2QWF7Uue16idzxfD40reaCb+XVaMM= X-Received: by 2002:a1f:97d1:: with SMTP id z200mr21078373vkd.15.1549285830611; Mon, 04 Feb 2019 05:10:30 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Date: Mon, 4 Feb 2019 14:10:17 +0100 Message-ID: To: Wes Cc: Claude Pache , PHP Internals Content-Type: multipart/alternative; boundary="00000000000096d8790581113795" Subject: Re: [PHP-DEV][RFC] Allow void return type variance From: george.banyard@gmail.com (Girgias) --00000000000096d8790581113795 Content-Type: text/plain; charset="UTF-8" On Mon, 4 Feb 2019 at 13:28, Wes wrote: > I know this too. I am often in touch with Levi and void variance is not > covered by his RFC > As a matter of fact, if you try to compile that PR void will behave exactly > like it does now > First of all, apologies as I needed a brush up on the difference between general variance and covariance. In fact, the RFC linked does not cover the variance of the void type. > My RFC targets 7.2 and 7.3 other than 7.4 > Secondly, I am nearly certain, but I would love to be proven wrong, that new features aren't backported to older PHP releases. So even then I don't think this will land in PHP 7.2/7.3 Now back to the proposal of the variance of void type. I'm not sure I see the point of it? Let me explain: if I define a method as void it means that it does stuff which doesn't/can't return a sensible value. Also, I am defining behavior and changing the return type, at least to me, is a change in behavior. Because a function/method which clearly is not intended to be used as a value can now under your proposal become one. Sure you can say that the return value may be only used by the child class but if I want to change my parent class to this child class I can't be sure that it will behave as before because *maybe* the child class needs the return value of this previously void method. Maybe I am just overthinking this however in my opinion if a return type needs to be changed from void to something you are trying to add behavior to a method which *probably* should go into its own method. Best regards George P. Banyard --00000000000096d8790581113795--