Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:86426 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 24422 invoked from network); 28 May 2015 17:39:44 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 May 2015 17:39:44 -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.213.177 as permitted sender) X-PHP-List-Original-Sender: morrison.levi@gmail.com X-Host-Fingerprint: 209.85.213.177 mail-ig0-f177.google.com Received: from [209.85.213.177] ([209.85.213.177:37368] helo=mail-ig0-f177.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 30/62-01144-FD257655 for ; Thu, 28 May 2015 13:39:44 -0400 Received: by igbsb11 with SMTP id sb11so45253784igb.0 for ; Thu, 28 May 2015 10:39:41 -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=WpNRQE3RD2+eSufT6sJIBT1EcA8nKpfQNxRWnqGwaC4=; b=Kt949ISqIfkjBbgP+dLJyj/zK0S8EeawzRiCaGYiPC0S2UWzuSMOyusJyilBb2cd0y 2FH1ozSyFsHmJSUcfHCHqM6syC9EjaQ/bzQgd+4pI9idxcmTg1GCrW3Vp6YFSWbfudz8 V7+aiTWTAXJtBCMOT843WhrcIoy60IrnmHOoQO3WPiQSYnyViHGWVS3qHl/Ksq1b6HrR FTAHSLRcPnNqwniWYodpJXaJ+CbebztlqVcoG2ldzD/sOTEJwuGeYvvOxCfkcfWdnT1J whK9R0oqmnpWnuYxjAN3xUdgmhMdHnDEJL4W/EOwi7KA1P/R9sT8/jBx4sZNDvN8kBd6 mI3Q== MIME-Version: 1.0 X-Received: by 10.50.43.227 with SMTP id z3mr12732245igl.12.1432834781538; Thu, 28 May 2015 10:39:41 -0700 (PDT) Sender: morrison.levi@gmail.com Received: by 10.79.98.67 with HTTP; Thu, 28 May 2015 10:39:41 -0700 (PDT) In-Reply-To: References: <5566BE78.20605@gmail.com> Date: Thu, 28 May 2015 11:39:41 -0600 X-Google-Sender-Auth: _ZzQjzisUhGSAFVPZWWdV_KxxXw 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: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.