Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:979 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 11032 invoked from network); 19 Apr 2003 17:39:37 -0000 Received: from unknown (HELO carmine.bestweb.net) (209.94.102.73) by pb1.pair.com with SMTP; 19 Apr 2003 17:39:37 -0000 Received: from [192.168.1.101] (ip216-179-71-153.cust.bestweb.net [216.179.71.153]) by carmine.bestweb.net (Postfix) with ESMTP id 00DA826B3E for ; Sat, 19 Apr 2003 12:39:32 -0500 (EST) To: internals@lists.php.net Content-Type: multipart/mixed; boundary="=-Cq5kAiD4ZvAFSw6lGAVR" Organization: Message-ID: <1050769070.827.1367.camel@hasele> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.3 Date: 19 Apr 2003 12:17:50 -0400 Subject: [patch] final use only for methods From: sterling@bumblebury.com (Sterling Hughes) --=-Cq5kAiD4ZvAFSw6lGAVR Content-Type: text/plain Content-Transfer-Encoding: 7bit The attached patch modifies zend_language_parser, having it generate a compiler error when final is used on a class property (since we are only allowing it for methods.) -Sterling -- "First they ignore you, then they laugh at you, then they fight you, then you win." - Gandhi --=-Cq5kAiD4ZvAFSw6lGAVR Content-Disposition: attachment; filename=final.diff Content-Type: text/x-patch; name=final.diff; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Index: zend_language_parser.y =================================================================== RCS file: /repository/ZendEngine2/zend_language_parser.y,v retrieving revision 1.114 diff -u -r1.114 zend_language_parser.y --- zend_language_parser.y 10 Apr 2003 15:43:47 -0000 1.114 +++ zend_language_parser.y 19 Apr 2003 17:38:07 -0000 @@ -514,7 +514,7 @@ ; variable_modifiers: - non_empty_member_modifiers { $$ = $1; } + non_empty_member_modifiers { $$ = $1; if ($$.u.constant.value.lval & ZEND_ACC_FINAL) { zend_error(E_COMPILE_ERROR, "Final modifier is only allowed for methods, not properties"); } } | T_VAR { $$.u.constant.value.lval = ZEND_ACC_PUBLIC; } ; --=-Cq5kAiD4ZvAFSw6lGAVR--