Skip to content

Commit 146ab0d

Browse files
committed
Deprecate AST version 45
1 parent 1e83887 commit 146ab0d

File tree

5 files changed

+7
-6
lines changed

5 files changed

+7
-6
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -529,9 +529,9 @@ Supported since 2017-07-19.
529529
* `\ast\parse_file` will now consistently return an empty statement list (similar to
530530
`\ast\parse_code`) if it is was passed a zero-byte file. Previously, it would return `null`.
531531

532-
### 45 (supported)
532+
### 45 (deprecated)
533533

534-
Supported since 2017-07-19.
534+
Supported since 2017-07-19. Deprecated since 2018-10-06.
535535

536536
This version normalizes the AST to PHP 7.2 format.
537537

ast.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -791,7 +791,7 @@ static const zend_long versions[] = {30, 35, 40, 45, 50};
791791
static const size_t versions_count = sizeof(versions)/sizeof(versions[0]);
792792

793793
static inline zend_bool ast_version_deprecated(zend_long version) {
794-
return version == 30 || version == 35 || version == 40;
794+
return version == 30 || version == 35 || version == 40 || version == 45;
795795
}
796796

797797
static zend_string *ast_version_info() {

tests/decl_normalization.phpt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ echo ast_dump($ast) . "\n";
4141

4242
?>
4343
--EXPECTF--
44+
Deprecated: ast\parse_code(): Version 45 is deprecated in %s on line %d
4445
array(4) {
4546
[0]=>
4647
string(13) "ast\Node\Decl"

tests/get_supported_versions.phpt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@ array(5) {
2020
[4]=>
2121
int(50)
2222
}
23-
array(2) {
23+
array(1) {
2424
[0]=>
25-
int(45)
26-
[1]=>
2725
int(50)
2826
}

tests/object_type.phpt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ AST_STMT_LIST
3333
returnType: AST_NAME
3434
flags: NAME_NOT_FQ (1)
3535
name: "object"
36+
37+
Deprecated: ast\parse_code(): Version 45 is deprecated in %s on line %d
3638
AST_STMT_LIST
3739
0: AST_FUNC_DECL
3840
flags: 0

0 commit comments

Comments
 (0)