Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:92728 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 32647 invoked from network); 25 Apr 2016 12:31:20 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 Apr 2016 12:31:20 -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.49 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.49 mail-wm0-f49.google.com Received: from [74.125.82.49] ([74.125.82.49:36578] helo=mail-wm0-f49.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B7/16-00233-71E0E175 for ; Mon, 25 Apr 2016 08:31:19 -0400 Received: by mail-wm0-f49.google.com with SMTP id v188so96105417wme.1 for ; Mon, 25 Apr 2016 05:31:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=N5UVq3siqi11c+bcPdHBTh7+LvuimyAX0YoF3nz/5UQ=; b=EExBskz43kYjpzzoyfDfR1HT/XaN4Z/Taf2Oogryz1kQcWbRuA7DJTNNkXutazCQ9M c9+sHUIoV1EENL9MNA3diSTHS6g9mYztMZvPUT4kgYcJuqtpg/9o2xPRcrMyNi2RQpNN Q9e1mdGPX5ZFc7GMgPyQDwtZWyAJ3qAibV/aP4I+staPpSM0h8ljHo4Yc13aYIJjaIjx 1alS6byFZznqdfG3SYz8zjSlotOngDrjwJ2E3EWqcHDJMFbrduDYqdSW6t69cpW4zc17 HilHW/L5FpIYBboQNkTaCCn3UnChDNiPQ4TV3H0CAL37HgVrdW4Gphzk1rgK1Qd5Iy6t SnGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=N5UVq3siqi11c+bcPdHBTh7+LvuimyAX0YoF3nz/5UQ=; b=HCA5cBpZeLflDV4TyZ8x1rr3aWrr9VrGw3wAXIyKv6VRt+uwcgenoUz6Ga+tylYHWJ MS2IXxMtVGdf9wtMp1RPi/NQkRjqt4L5dRsDDoaGhfjiUwJqGvHGejno5vP9oBpXWwcl gDUeAIW16TJrkOI1Rzjgv0qG82rnnAGGEvo2630QnxyBhmF5iaeOLpfdHCAQILMKm22V GIyU0XdVx1CsV9Kp3Zb14khxGdU49BwJs2CWWQpBDSM/+KYcuo3BfaosFfFkuxgBiKgY zg4nmmyRVFS1FXjCAgG7901OeZsvgOlpz+TJMCm3fdOtLWMHWV5la2OoISjB4AT48NH0 a1dg== X-Gm-Message-State: AOPr4FUYqkOtZHx8h4tTgDixXwkCU9pC6PMyanopVVStqkAtT0kzo/k9PMr151f5T0vqCA== X-Received: by 10.194.113.3 with SMTP id iu3mr39513133wjb.149.1461587477034; Mon, 25 Apr 2016 05:31:17 -0700 (PDT) Received: from [192.168.0.82] ([93.188.182.58]) by smtp.googlemail.com with ESMTPSA id w79sm18554899wme.19.2016.04.25.05.31.15 for (version=TLSv1/SSLv3 cipher=OTHER); Mon, 25 Apr 2016 05:31:16 -0700 (PDT) To: internals@lists.php.net References: Message-ID: <571E0D99.2060202@gmail.com> Date: Mon, 25 Apr 2016 13:29:13 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] PHP Attributes From: rowan.collins@gmail.com (Rowan Collins) Dan Ackroyd wrote on 24/04/2016 21:45: > The point > I was trying to make is that it explicitly says that "this is a > userland attribute", rather than using the generic <<...>> syntax, > which we might want to use for non-userland attributes at some point. I think framing the problem as "engine vs userland" is misleading; what you are actually saying is "how do we avoid name collisions?" There's currently no difference in syntax between userland and engine functions and classes, and *that is a good thing*, because it means you can transparently apply polyfills, create C / Zephir extensions to replace performance-sensitive functions, etc. The same could be done for annotations - if it's possible to create a userland DBC library, then why shouldn't it be able to polyfill the same syntax as an engine one? As mentioned elsewhere, in an OO implementation of annotations, the existing namespace hierarchy could be used (which includes the \php\ reservation, which we've never taken advantage of). If it's not, we are left with naming conventions. I would suggest that even if we don't have objects representing the annotations, "\" should be allowed, and encouraged, in their names. Thus, *by convention*, attributes would be prefixed with at least a vendor name ("<>", etc). PHP could reserve "__" and "php\" for future internal use, but also semi-reserve the global namespace, as described here: http://php.net/manual/en/userlandnaming.rules.php > PHP owns the top-level namespace but tries to find decent descriptive names and avoid any obvious clashes. If somebody creates a userland library that uses <>, it's up to them to deal with the consequences if PHP later implements an incompatible version, just as it would be if they wrote a function called dbc_require(), or DBC::require(). Regards, -- Rowan Collins [IMSoP]