Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:86419 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 82070 invoked from network); 28 May 2015 07:06:42 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 May 2015 07:06:42 -0000 Authentication-Results: pb1.pair.com header.from=smalyshev@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=smalyshev@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.192.176 as permitted sender) X-PHP-List-Original-Sender: smalyshev@gmail.com X-Host-Fingerprint: 209.85.192.176 mail-pd0-f176.google.com Received: from [209.85.192.176] ([209.85.192.176:35848] helo=mail-pd0-f176.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id EF/80-11844-18EB6655 for ; Thu, 28 May 2015 03:06:42 -0400 Received: by pdfh10 with SMTP id h10so35227944pdf.3 for ; Thu, 28 May 2015 00:06:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; bh=z4OAoR7khYTB0D202zl8j7O5wN8hWqfeqlw2Tt8NX4o=; b=FXrPuTtzIM4Ym75o1FlUGbNq+/yuPEaOx3x1B4ecUVoNVkddf4YzI98fyyMj172q97 USlNKxD8suKV3ycRn0S6DvI6Qc0b0MJnDO+oyEUBQ3umfs/MS25xPt7TkQZJTrXaOiyc EXAlkdGhdTdfMe1rFh86wk8NMYYV6GaRZQswXfcN5SqVNgUjjyktjFeTgSMgpJfOsg7V 2dYK69gvIV67sLW+1L75y8NTToLT7Xj5QqbkxImglelQis9PYPUtXdt7Pz8P05iSMlgg k/F3N1xEaOQ/O+mIh+hITi+bGqd7co2JHtacG0zGS3S6bARdot07SF+XqWWPpdhm+O0q ennw== X-Received: by 10.70.44.76 with SMTP id c12mr2808918pdm.49.1432796799275; Thu, 28 May 2015 00:06:39 -0700 (PDT) Received: from Stas-Air.local (108-66-6-48.lightspeed.sntcca.sbcglobal.net. [108.66.6.48]) by mx.google.com with ESMTPSA id da3sm1267416pdb.8.2015.05.28.00.06.37 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 May 2015 00:06:37 -0700 (PDT) Message-ID: <5566BE78.20605@gmail.com> Date: Thu, 28 May 2015 00:06:32 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: PHP Internals Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: return/parameter types for magic functions From: smalyshev@gmail.com (Stanislav Malyshev) 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. I've created a bug https://bugs.php.net/bug.php?id=69718 to track this. Not sure if this really needs an RFC. -- Stas Malyshev smalyshev@gmail.com