Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:86090 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 43819 invoked from network); 30 Apr 2015 12:29:47 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Apr 2015 12:29:47 -0000 Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.46 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.46 mail-wg0-f46.google.com Received: from [74.125.82.46] ([74.125.82.46:34268] helo=mail-wg0-f46.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 79/80-38733-A3022455 for ; Thu, 30 Apr 2015 08:29:47 -0400 Received: by wgso17 with SMTP id o17so60548438wgs.1 for ; Thu, 30 Apr 2015 05:29:43 -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:references :in-reply-to:content-type:content-transfer-encoding; bh=0WdtvAibb7pt6hDCsWgFDHrheyxdE7Q3dKIYrlHNZ2c=; b=Cmu6jYiSOcd0eHqdhDxmHNxN7E6OVYKesnGw8qYfLGfxKrkzuiGoGTOkhb9zsei+mS 9Kx+YIAqRzzwz7y5ULg5ie0saTHHc5EvWJbY78YcjrO9wzXl8yL2SYX6pJ7/pjyfv9T8 5ylcmxpFH1aeBTMyvsIm/ZN5nKtUTQE9OUGaUuzrwpVevz0s6KlF+gZhRV38hqIIrwDX 67fYLzeY8fyF6ZdGZR6KSQgNUYd7F7H59kj3emRlTJNQ7VEK3PAJW3PCmujVnNVUqq9L SX6PHY+DyTaGWRs0OTmeFtKx1b0IWlITsZPpxkFdvpYZBsk9PpjEB33KM5UvjCV3nSAt h1Vg== X-Received: by 10.180.78.65 with SMTP id z1mr5230916wiw.14.1430396983700; Thu, 30 Apr 2015 05:29:43 -0700 (PDT) Received: from [192.168.0.159] ([62.189.198.114]) by mx.google.com with ESMTPSA id n3sm2558900wix.1.2015.04.30.05.29.42 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Apr 2015 05:29:42 -0700 (PDT) Message-ID: <55421FCD.4080704@gmail.com> Date: Thu, 30 Apr 2015 13:27:57 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: internals@lists.php.net References: <55415E10.7040908@gmx.de> <016501d08324$8d300460$a7900d20$@php.net> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Reserve even more type hints RFC From: rowan.collins@gmail.com (Rowan Collins) Florian Margaine wrote on 30/04/2015 10:23: > > We don't need a warning there, we need a fatal error. These names are > > *invalid* as class names. > Should we throw fatal errors for functions starting with 2 underscores too? Actually, soft reservation has genuine advantages for those: 1) It allows forwards compatibility - you can add an __debugInfo() method to a project which supports PHP 5.5, even though it will never be used until PHP 5.6. Since we have no conditional compilation, there's no other way of enabling the feature only if it's available. 2) It can be used to implement userland compatibility shims. For instance, a framework's enhanced dump function could manually call __debugInfo() on versions <5.6, or an event handling framework could accept objects with an __invoke() method as callbacks on PHP 5.2. I can think of no such advantage with reserved keywords for basic types, since there is no way to use them in current code which would be compatible with their future use. Regards, -- Rowan Collins [IMSoP]