Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:86436 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 50930 invoked from network); 28 May 2015 22:37:03 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 May 2015 22:37:03 -0000 Authentication-Results: pb1.pair.com smtp.mail=morrison.levi@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=morrison.levi@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.218.52 as permitted sender) X-PHP-List-Original-Sender: morrison.levi@gmail.com X-Host-Fingerprint: 209.85.218.52 mail-oi0-f52.google.com Received: from [209.85.218.52] ([209.85.218.52:33243] helo=mail-oi0-f52.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id FC/76-01144-E8897655 for ; Thu, 28 May 2015 18:37:02 -0400 Received: by oiww2 with SMTP id w2so43874076oiw.0 for ; Thu, 28 May 2015 15:37:00 -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=+fZzFxP+W9GGHt4kawJwSQL/PsGIy/whsIUl5Warej8=; b=WU4vocWTp4L6cPMBm0MZgvCRWUggBadorZrjB+Ptmi8YE+bh6IUOLmGKN/oXYXwLHk UUlenxVc/QHicenPyOJ6bi8Brimz2IjMrAITQKU7JXSrUbI9njNcTKVbSbph9ewsfxzy O7iXQjQZyqziVV5xbAZ6p5tsQKukScqzHiob+/BH/lIYtDHlKvJ7tZC5ioUc+3Bc6oG5 vQlFbfashXOFcPaRkW5pfO2T91suF8j5dwqnyoCyOTu5y6VhxY+2eJUpEFkaxtGcKeiv 1EawsmUPeAKKJs98CkqMj879FHUsbELFgD8AR8Ba+rgXx/A+dLyhm5obwPXgaIVbrIEc axEw== MIME-Version: 1.0 X-Received: by 10.202.64.195 with SMTP id n186mr4194126oia.53.1432852619993; Thu, 28 May 2015 15:36:59 -0700 (PDT) Sender: morrison.levi@gmail.com Received: by 10.202.105.69 with HTTP; Thu, 28 May 2015 15:36:59 -0700 (PDT) In-Reply-To: References: <5566BE78.20605@gmail.com> Date: Thu, 28 May 2015 16:36:59 -0600 X-Google-Sender-Auth: nbgm-b0-fd8ZVdO2KM6xSUDUsgk Message-ID: To: Stanislav Malyshev Cc: PHP Internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] return/parameter types for magic functions From: levim@php.net (Levi Morrison) On Thu, May 28, 2015 at 11:39 AM, Levi Morrison wrote: > On Thu, May 28, 2015 at 11:38 AM, Levi Morrison wrote: >> On Thu, May 28, 2015 at 1:06 AM, Stanislav Malyshev wrote: >>> Hi! >>> >>> Since we now allow defining return value types for functions, one can >>> also create definition for magic functions that make no sense, such as >>> __toString() : float or __isset() : Closure. I think we should restrict >>> such definitions - either to types that makes sense or in case of >>> methods that aren't supposed to return anything useful, completely. We >>> already do this for ctors, dtors and __clone but not consistently for >>> other magics. Also some values for parameter types make no sense. >> >> My original patch for return types did not allow return types for >> ctors, dtors, and __clone. It seems you did not preserve this? In any >> case no RFC is needed because this was outlined in the RFC: >> https://wiki.php.net/rfc/return_types#methods_which_cannot_declare_return_types >> >> The only one that should allow anything for now is __toString which >> would be permitted to declare a return type of string. > > My apologies; I misread Dmitry's original statement. Disregard my message. s/Dmitry/Stas/; seems I shouldn't post anything today; sorry for all the mistakes and noise.