Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:88076 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 64218 invoked from network); 7 Sep 2015 06:43:50 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Sep 2015 06:43:50 -0000 Authentication-Results: pb1.pair.com smtp.mail=sean@siobud.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=sean@siobud.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain siobud.com designates 104.236.58.159 as permitted sender) X-PHP-List-Original-Sender: sean@siobud.com X-Host-Fingerprint: 104.236.58.159 siobud.com Received: from [104.236.58.159] ([104.236.58.159:57787] helo=siobud.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2E/33-40368-3223DE55 for ; Mon, 07 Sep 2015 02:43:49 -0400 Received: from 3006.local (c-73-8-76-141.hsd1.il.comcast.net [73.8.76.141]) by siobud.com (Postfix) with ESMTPSA id E88C0D7CED; Mon, 7 Sep 2015 06:43:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=siobud.com; s=mail; t=1441608193; bh=mW5aw6N4isr/6FZBQl7XMB96lNmUbi6uF2HUYbfB0pY=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=TO1pf8da1Ihss7g/fi+Zklz4uIGnCCx/XdQ0QIR0XiHfWxXnQrKgaQxfBtFSebK6e Y8cqXhWtD+W7CXBiqoG419qySyKdnHzWsUvuL6caLDdxk7La++1rvq5n5jB2vQOjpg Un+FjfR0wuGGYVMhbJmOdaUxE6iCKhoE70/Lvuhw= Date: Mon, 7 Sep 2015 01:43:10 -0500 To: Andrea Faulds Cc: internals@lists.php.net Message-ID: <20150907064310.GA12497@3006.local> References: <20150827173432.GA71000@3006.local> <28.A5.59944.15C7CE55@pb1.pair.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <28.A5.59944.15C7CE55@pb1.pair.com> User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [PHP-DEV] Re: [RFC] [Concept] Class Constant visibility modifiers in PHP 7.1+ From: sean@siobud.com (Sean DuBois) On Sun, Sep 06, 2015 at 06:47:56PM +0100, Andrea Faulds wrote: > Hi Sean, > > Sean DuBois wrote: > > > >I am starting this discussion to get peoples opinion on the overall feature, and find someone > >who would be interested in watching over my progress and making sure I > >do the right things to hopefully get this merged. > > > >The PHP bug tracker contains a few simple entries for a adding visibility modifiers to class constants. > >https://bugs.php.net/bug.php?id=27022 > > > >I would be the one implementing this, and have a basic working version already (that > >takes shortcuts like reusing property_info) but it works! > >https://github.com/Sean-Der/php-src/compare/master...bug-69980-class-constants#diff-6231c13c8582758f41a5e2a015e3b5c5R1 > >There are cases where runtime/compile time checks pass/fail incorrectly, > >but working on that now. > > > >This change would involve breaking the API, but wouldn't involved any > >language breaking changes. All current const declarations would just > >default to public and keep the same behavior. > > Funny you should propose this now, I was wanting this feature just the other > day. This would be a useful addition, and clean up a strange inconsistency: > why can methods and properties have visibility modifiers, but not constants? > > I'd love to see this in PHP. Are you going to write an RFC? > > Thanks! > -- > Andrea Faulds > http://ajf.me/ > Just one of those things that you you wish you had, but then end up solving with other things (static properties) so we will see how long it takes me to blunder through it :) Reeze Xia started an RFC, but didn't have time to finish it. We talked over GitHub and I will be taking it over fully. https://wiki.php.net/rfc/class_const_visibility I am just waiting on RFC Karma, after I get that I will start filling it in!