mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Require abstract classes to be explicitly declared 'abstract', in order to
avoid making developers traverse the entire class/interface hierarchy before they can figure out whether a class is instantiable (ok, so it makes sense :)
This commit is contained in:
parent
af4aa97d1e
commit
0338111950
4 changed files with 50 additions and 18 deletions
|
@ -294,13 +294,14 @@ unticked_class_declaration_statement:
|
|||
implements_list
|
||||
'{'
|
||||
class_statement_list
|
||||
'}' { zend_do_end_class_declaration(&$1 TSRMLS_CC); }
|
||||
'}' { zend_do_end_class_declaration(&$1, &$2 TSRMLS_CC); }
|
||||
;
|
||||
|
||||
|
||||
class_entry_type:
|
||||
T_CLASS { $$.u.constant.value.lval = T_CLASS; }
|
||||
| T_INTERFACE { $$.u.constant.value.lval = T_INTERFACE; }
|
||||
T_CLASS { $$.u.constant.value.lval = 0; }
|
||||
| T_ABSTRACT T_CLASS { $$.u.constant.value.lval = ZEND_ACC_ABSTRACT_CLASS; }
|
||||
| T_INTERFACE { $$.u.constant.value.lval = ZEND_ACC_INTERFACE; }
|
||||
;
|
||||
|
||||
namespace_declaration_statement:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue