Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:49646 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 59042 invoked from network); 14 Sep 2010 18:30:17 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Sep 2010 18:30:17 -0000 Authentication-Results: pb1.pair.com smtp.mail=jbondc@openmv.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=jbondc@openmv.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain openmv.com from 64.15.152.204 cause and error) X-PHP-List-Original-Sender: jbondc@openmv.com X-Host-Fingerprint: 64.15.152.204 mail.ca.gdesolutions.com Received: from [64.15.152.204] ([64.15.152.204:55111] helo=mail.ca.gdesolutions.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4D/84-33442-03FBF8C4 for ; Tue, 14 Sep 2010 14:30:11 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.ca.gdesolutions.com (Postfix) with ESMTP id 784035C23; Tue, 14 Sep 2010 14:30:02 -0400 (EDT) X-Virus-Scanned: amavisd-new at gdesolutions.com Received: from mail.ca.gdesolutions.com ([127.0.0.1]) by localhost (mail.ca.gdesolutions.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Q96eQlWPseMP; Tue, 14 Sep 2010 14:30:02 -0400 (EDT) Received: from djbondc (modemcable083.208-56-74.mc.videotron.ca [74.56.208.83]) by mail.ca.gdesolutions.com (Postfix) with ESMTP id 0F8E65C21; Tue, 14 Sep 2010 14:30:01 -0400 (EDT) To: "'Nate Abele'" , "'PHP Development'" References: <39505F13-655A-43AF-941E-77750B7F7201@gmail.com> In-Reply-To: <39505F13-655A-43AF-941E-77750B7F7201@gmail.com> Date: Tue, 14 Sep 2010 14:30:01 -0400 Message-ID: <001601cb543a$d81ebac0$885c3040$@com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: ActUMfKSTSqQc5HgSEaZtcR6VMFA8gABSZHw Content-Language: en-ca Subject: RE: [PHP-DEV] Re: Re: PHP Annotations RFC + Patch From: jbondc@openmv.com ("Jonathan Bond-Caron") On Tue Sep 14 01:25 PM, Nate Abele wrote: > > Sorry, but I don't see how this is even remotely close to being > appropriate for PHP. Maybe I'm missing something. :-) > I agree, the use cases are just not there Though maybe some form of "annotations" could be useful in php as a "pluggable type": http://bartoszmilewski.wordpress.com/2009/01/18/java-pluggable-types/ But this isn't an annotation as just plain metadata, the parser could do something with the annotation. i.e. class Phone { @ReadOnly public $id; @PhoneNumber public $number; } class PhoneNumber implements TypeAnnotation { static function getTypeValue($val) { return preg_replace('~[^0-9]~', '', $val); } } Instead of ~ class Phone { protected $_number; function __get($prop) { if($prop === 'number') return $this->_number; } function __set($prop, $val) { if($prop === 'number') $this->_number = preg_replace('~[^0-9]~', '', $val); } }