Skip to content

Commit 91e7ffc

Browse files
authored
Fix substr return type on php<8 - use benevolent union type
1 parent 69095c7 commit 91e7ffc

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

resources/functionMap.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11798,7 +11798,7 @@
1179811798
'strtr' => ['string', 'str'=>'string', 'from'=>'string', 'to'=>'string'],
1179911799
'strtr\'1' => ['string', 'str'=>'string', 'replace_pairs'=>'array'],
1180011800
'strval' => ['string', 'var'=>'mixed'],
11801-
'substr' => ['string', 'string'=>'string', 'start'=>'int', 'length='=>'int'],
11801+
'substr' => ['__benevolent<string|false>', 'string'=>'string', 'start'=>'int', 'length='=>'int'],
1180211802
'substr_compare' => ['int|false', 'main_str'=>'string', 'str'=>'string', 'offset'=>'int', 'length='=>'int', 'case_sensitivity='=>'bool'],
1180311803
'substr_count' => ['0|positive-int', 'haystack'=>'string', 'needle'=>'string', 'offset='=>'int', 'length='=>'int'],
1180411804
'substr_replace' => ['string|array', 'str'=>'string|array', 'repl'=>'mixed', 'start'=>'mixed', 'length='=>'mixed'],

resources/functionMap_php80delta.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@
102102
'strripos' => ['int|false', 'haystack'=>'string', 'needle'=>'string', 'offset='=>'int'],
103103
'strrpos' => ['int|false', 'haystack'=>'string', 'needle'=>'string', 'offset='=>'int'],
104104
'strstr' => ['string|false', 'haystack'=>'string', 'needle'=>'string', 'before_needle='=>'bool'],
105+
'substr' => ['string', 'string'=>'string', 'start'=>'int', 'length='=>'int'],
105106
'version_compare' => ['int|bool', 'version1'=>'string', 'version2'=>'string', 'operator='=>'string'],
106107
'xml_parser_create' => ['XMLParser', 'encoding='=>'string'],
107108
'xml_parser_create_ns' => ['XMLParser', 'encoding='=>'string', 'sep='=>'string'],
@@ -227,6 +228,7 @@
227228
'strripos' => ['int|false', 'haystack'=>'string', 'needle'=>'string|int', 'offset='=>'int'],
228229
'strrpos' => ['int|false', 'haystack'=>'string', 'needle'=>'string|int', 'offset='=>'int'],
229230
'strstr' => ['string|false', 'haystack'=>'string', 'needle'=>'string|int', 'before_needle='=>'bool'],
231+
'substr' => ['__benevolent<string|false>', 'string'=>'string', 'start'=>'int', 'length='=>'int'],
230232
'version_compare' => ['int|bool', 'version1'=>'string', 'version2'=>'string', 'operator='=>'string'],
231233
'xml_parser_create' => ['resource', 'encoding='=>'string'],
232234
'xml_parser_create_ns' => ['resource', 'encoding='=>'string', 'sep='=>'string'],

0 commit comments

Comments
 (0)