Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:50288 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 54456 invoked from network); 17 Nov 2010 07:44:36 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Nov 2010 07:44:36 -0000 Authentication-Results: pb1.pair.com header.from=dave@dmi.me.uk; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=dave@dmi.me.uk; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain dmi.me.uk designates 77.68.52.130 as permitted sender) X-PHP-List-Original-Sender: dave@dmi.me.uk X-Host-Fingerprint: 77.68.52.130 server77-68-52-130.live-servers.net Received: from [77.68.52.130] ([77.68.52.130:52466] helo=scaramanga.siterage.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 20/B1-40885-3E783EC4 for ; Wed, 17 Nov 2010 02:44:36 -0500 Received: from localhost (scaramanga.siterage.net [127.0.0.1]) by scanner.scaramanga.siterage.net (SiteRage Mail Server) with ESMTP id 558351067C2; Wed, 17 Nov 2010 07:44:32 +0000 (GMT) X-Spam-Flag: NO X-Spam-Score: -0.97 X-Spam-Level: X-Spam-Status: No, score=-0.97 required=5 tests=[ALL_TRUSTED=-1.8, AWL=-0.300, DNS_FROM_OPENWHOIS=1.13] autolearn=no Received: from scaramanga.siterage.net ([127.0.0.1]) by localhost (scaramanga.siterage.net [127.0.0.1]) (amavisd-new, port 10024) with LMTP id TRwEWRhN0cJ2; Wed, 17 Nov 2010 07:44:32 +0000 (GMT) Received: from [192.168.1.100] (unknown [78.146.53.156]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by smtp.siterage.net (SiteRage Mail Server) with ESMTPSA id D33EA84928; Wed, 17 Nov 2010 07:44:31 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=dmi.me.uk; s=scara-dkim; t=1289979871; bh=tIq9o04oXk2RM24FQXxymCPk4nh5JxoKgvtYDv4dNzY=; h=Message-ID:Date:From:MIME-Version:To:CC:Subject:References: In-Reply-To:Content-Type:Content-Transfer-Encoding; b=MPUH73ePI/fyxXm6nslzbdDeuEQ2t5B+lb7NeeKpUiEY+0cWiUxD9siNnk4O5o26M tK1xsDPvGbdbWC4ZsDt15TJk0LhgmOR5ZgPeFs1GAsi4EW7nKG2/Gu8iosFuep5qQ3 KMJmHEF6IrHXR/iSX8uyvLRZFpJHpDAlgR8Hsn9Y= Message-ID: <4CE387DF.5050903@dmi.me.uk> Date: Wed, 17 Nov 2010 07:44:31 +0000 User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:1.8.1.23) Gecko/20090812 Thunderbird/2.0.0.23 Mnenhy/0.7.6.666 MIME-Version: 1.0 To: Alec CC: internals@lists.php.net References: <887FE7CFF6F8DE4BB3A9535F53AFD06A2C59B588@il-ex2.zend.net> <887FE7CFF6F8DE4BB3A9535F53AFD06A2C59B6A0@il-ex2.zend.net> <887FE7CFF6F8DE4BB3A9535F53AFD06A2C59D788@il-ex2.zend.net> In-Reply-To: X-Enigmail-Version: 1.1.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] PHP 5.4 - Meta attribute (aka. Annotations) supportdiscussion From: dave@dmi.me.uk (Dave Ingram) On 16/11/10 21:56, Alec wrote: > [snip] > > attribute RestMethod('/do/something', 'Do Stuff', 'Does something.', > array( > 'arg1' => 'A cool argument!' > )); > public static DoSomething($arg1) { > ... > > or > > attribute Example('arg', 'arg2', 3, (time() > 0 ? true : false)); > class Demo { > ... > > That way it is clear that that line is an attribute. If the person > doesn't know what an "attribute in PHP" is, they can Google it. > > This does the following: > - No new branch of syntax is introduced like C# style annotations or > parsed docblocks would. The syntax is very similar to standard PHP > (the only thing missing is the "new" before the class name, and the > only new thing is the word "attribute") > > - This doesn't add significant complexity. It essentially makes > attributes autocalled class constructors. (As a side note, I don't > think any part of PHP is significantly complex, it just isn't > consistent--making it seem complex). > > - It is quite clear that that line is an attribute. People will be > able to easily Google, find and read the PHP docs for an explanation. As a karma-less user, I actually quite like this syntax and it feels very PHP-like to me. Making it trivially easy for people to search for the explanation of a feature is an excellent idea. Dave