Skip to content

Commit b118bc6

Browse files
committed
Remove version 10
1 parent 2ce4fe7 commit b118bc6

File tree

4 files changed

+7
-46
lines changed

4 files changed

+7
-46
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -482,9 +482,9 @@ Supported since 2015-10-21. Deprecated since 2016-04-30.
482482
`AST_PROP_ELEM`. This means that each property in one property declaration can have its own
483483
doc comment.
484484

485-
### 10 (deprecated)
485+
### 10 (removed)
486486

487-
Initial.
487+
Initial. Removed since 2016-08-04.
488488

489489
Differences to PHP-Parser
490490
-------------------------

ast.c

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -536,22 +536,8 @@ static void ast_to_zval(zval *zv, zend_ast *ast, zend_long version) {
536536
ast_update_property(zv, AST_STR(str_flags), &tmp_zv, AST_CACHE_SLOT_FLAGS);
537537
}
538538

539-
if (version < 15 && ast->kind == ZEND_AST_PROP_DECL) {
540-
/* Before version 15 the first docComment was stored on the PROP_DECL */
541-
zend_ast_list *props = zend_ast_get_list(ast);
542-
uint32_t i;
543-
for (i = 0; i < props->children; ++i) {
544-
zend_ast *prop = props->child[i];
545-
if (prop->child[2]) {
546-
ZVAL_STR_COPY(&tmp_zv, zend_ast_get_str(prop->child[2]));
547-
ast_update_property(zv, AST_STR(str_docComment), &tmp_zv, NULL);
548-
break;
549-
}
550-
}
551-
}
552-
553539
/* Convert doc comments on properties and constants into properties */
554-
if (version >= 15 && ast->kind == ZEND_AST_PROP_ELEM && ast->child[2]) {
540+
if (ast->kind == ZEND_AST_PROP_ELEM && ast->child[2]) {
555541
ZVAL_STR_COPY(&tmp_zv, zend_ast_get_str(ast->child[2]));
556542
ast_update_property(zv, AST_STR(str_docComment), &tmp_zv, NULL);
557543
}
@@ -568,7 +554,7 @@ static void ast_to_zval(zval *zv, zend_ast *ast, zend_long version) {
568554
ast_fill_children_ht(Z_ARRVAL(tmp_zv), ast, version);
569555
}
570556

571-
static const zend_long versions[] = {10, 15, 20, 30, 35, 40};
557+
static const zend_long versions[] = {15, 20, 30, 35, 40};
572558
static const size_t versions_count = sizeof(versions)/sizeof(versions[0]);
573559

574560
static zend_string *ast_version_info() {
@@ -602,7 +588,7 @@ static int ast_check_version(zend_long version) {
602588
zend_string *version_info;
603589

604590
if (ast_version_known(version)) {
605-
if (version == 10 || version == 15 || version == 20) {
591+
if (version == 15 || version == 20) {
606592
php_error_docref(NULL, E_DEPRECATED,
607593
"Version " ZEND_LONG_FMT " is deprecated", version);
608594
}

tests/prop_doc_comments.phpt

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -20,35 +20,10 @@ class A {
2020
}
2121
PHP;
2222

23-
echo ast_dump(ast\parse_code($code, $version=10)), "\n";
2423
echo ast_dump(ast\parse_code($code, $version=15)), "\n";
2524

2625
?>
2726
--EXPECTF--
28-
Deprecated: ast\parse_code(): Version 10 is deprecated in %s on line %d
29-
AST_STMT_LIST
30-
0: AST_CLASS
31-
flags: 0
32-
name: A
33-
0: null
34-
1: null
35-
2: AST_STMT_LIST
36-
0: AST_PROP_DECL
37-
flags: MODIFIER_PUBLIC (256)
38-
docComment: /** docComment $a */
39-
0: AST_PROP_ELEM
40-
0: "a"
41-
1: null
42-
1: AST_PROP_DECL
43-
flags: MODIFIER_PUBLIC (256)
44-
docComment: /** docComment $b */
45-
0: AST_PROP_ELEM
46-
0: "b"
47-
1: null
48-
1: AST_PROP_ELEM
49-
0: "c"
50-
1: null
51-
5227
Deprecated: ast\parse_code(): Version 15 is deprecated in %s on line %d
5328
AST_STMT_LIST
5429
0: AST_CLASS

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): {10, 15, 20, %s}
21-
Unknown version 100. Current version is %d. All versions (including experimental): {10, 15, 20, %s}
20+
No version specified. Current version is %d. All versions (including experimental): {15, 20, 30, %s}
21+
Unknown version 100. Current version is %d. All versions (including experimental): {15, 20, 30, %s}

0 commit comments

Comments
 (0)