Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:981 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 15548 invoked from network); 19 Apr 2003 17:45:50 -0000 Received: from unknown (HELO moutng.kundenserver.de) (212.227.126.183) by pb1.pair.com with SMTP; 19 Apr 2003 17:45:50 -0000 Received: from [212.227.126.160] (helo=mrelayng.kundenserver.de) by moutng.kundenserver.de with esmtp (Exim 3.35 #1) id 196wPL-0006uM-00; Sat, 19 Apr 2003 19:45:47 +0200 Received: from [217.80.180.223] (helo=[217.80.180.223]) by mrelayng.kundenserver.de with asmtp (Exim 3.35 #1) id 196wPK-0004Nz-00; Sat, 19 Apr 2003 19:45:46 +0200 To: Sterling Hughes Cc: internals@lists.php.net In-Reply-To: <1050769070.827.1367.camel@hasele> References: <1050769070.827.1367.camel@hasele> Content-Type: text/plain Organization: Message-ID: <1050774385.5685.13.camel@localhost> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.1 Date: 19 Apr 2003 19:46:25 +0200 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [patch] final use only for methods From: thekid@thekid.de (Timm Friebe) On Sat, 2003-04-19 at 18:17, Sterling Hughes wrote: > 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.) You could then also drop: if (parent_info->flags & ZEND_ACC_FINAL) { zend_error(E_COMPILE_ERROR, "Cannot override final property %s::$%s", parent_ce->name, hash_key->arKey); } and if (((current_access_type->u.constant.value.lval | new_modifier->u.constant.value.lval) & (ZEND_ACC_ABSTRACT | ZEND_ACC_FINAL)) == (ZEND_ACC_ABSTRACT | ZEND_ACC_FINAL)) { zend_error(E_COMPILE_ERROR, "Cannot use the final modifier on an abstract class member"); } and if (((current_access_type->u.constant.value.lval | new_modifier->u.constant.value.lval) & (ZEND_ACC_PRIVATE | ZEND_ACC_FINAL)) == (ZEND_ACC_PRIVATE | ZEND_ACC_FINAL)) { zend_error(E_COMPILE_ERROR, "Cannot use the final modifier on a private class member"); } from zend_compile.c - Timm