Skip to content

Commit 0b1db79

Browse files
committed
Drop support for version 20
1 parent b815e10 commit 0b1db79

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -458,9 +458,9 @@ Supported since 2015-03-10.
458458

459459
* Use string names for child nodes of kinds with fixed length.
460460

461-
### 20 (deprecated)
461+
### 20 (removed)
462462

463-
Supported since 2015-12-14. Deprecated since 2016-08-04.
463+
Supported since 2015-12-14. Deprecated since 2016-08-04. Removed since 2017-01-18.
464464

465465
* `AST_GREATER`, `AST_GREATER_EQUAL`, `AST_OR`, `AST_AND` nodes are now represented using
466466
`AST_BINARY_OP` with flags `BINARY_IS_GREATER`, `BINARY_IS_GREATER_OR_EQUAL`, `BINARY_BOOL_OR`

ast.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ static void ast_create_virtual_node_ex(
290290
va_start(va, num_children);
291291
for (i = 0; i < num_children; i++) {
292292
zval *child_zv = va_arg(va, zval *);
293-
zend_string *child_name = version >= 30 ? ast_kind_child_name(kind, i) : NULL;
293+
zend_string *child_name = ast_kind_child_name(kind, i);
294294
if (child_name) {
295295
zend_hash_add_new(Z_ARRVAL(tmp_zv), child_name, child_zv);
296296
} else {
@@ -314,8 +314,7 @@ static void ast_fill_children_ht(HashTable *ht, zend_ast *ast, zend_long version
314314
zend_ast **children = ast_get_children(ast, &count);
315315
for (i = 0; i < count; ++i) {
316316
zend_ast *child = children[i];
317-
zend_string *child_name =
318-
!is_list && version >= 30 ? ast_kind_child_name(ast->kind, i) : NULL;
317+
zend_string *child_name = !is_list ? ast_kind_child_name(ast->kind, i) : NULL;
319318
zval child_zv;
320319

321320
if (ast->kind == ZEND_AST_STMT_LIST) {
@@ -555,7 +554,7 @@ static void ast_to_zval(zval *zv, zend_ast *ast, zend_long version) {
555554
ast_fill_children_ht(Z_ARRVAL(tmp_zv), ast, version);
556555
}
557556

558-
static const zend_long versions[] = {20, 30, 35, 40};
557+
static const zend_long versions[] = {30, 35, 40};
559558
static const size_t versions_count = sizeof(versions)/sizeof(versions[0]);
560559

561560
static zend_string *ast_version_info() {
@@ -589,7 +588,7 @@ static int ast_check_version(zend_long version) {
589588
zend_string *version_info;
590589

591590
if (ast_version_known(version)) {
592-
if (version == 20) {
591+
if (0) {
593592
php_error_docref(NULL, E_DEPRECATED,
594593
"Version " ZEND_LONG_FMT " is deprecated", version);
595594
}

tests/version_errors.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ try {
1717

1818
?>
1919
--EXPECTF--
20-
No version specified. Current version is %d. All versions (including experimental): {20, 30, 35, %s}
21-
Unknown version 100. Current version is %d. All versions (including experimental): {20, 30, 35, %s}
20+
No version specified. Current version is %d. All versions (including experimental): {30, 35, %s}
21+
Unknown version 100. Current version is %d. All versions (including experimental): {30, 35, %s}

0 commit comments

Comments
 (0)