Skip to content

Commit

Permalink
Use positive-int in parameters only on PHP 8
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Aug 20, 2021
1 parent 2f1615b commit 119facc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion resources/functionMap.php
Original file line number Diff line number Diff line change
Expand Up @@ -11696,7 +11696,7 @@
'str_replace' => ['string|array', 'search'=>'string|array', 'replace'=>'string|array', 'subject'=>'string|array', '&w_replace_count='=>'int'],
'str_rot13' => ['string', 'str'=>'string'],
'str_shuffle' => ['string', 'str'=>'string'],
'str_split' => ['array<int,string>|false', 'str'=>'string', 'split_length='=>'positive-int'],
'str_split' => ['array<int,string>|false', 'str'=>'string', 'split_length='=>'int'],
'str_word_count' => ['array<int,string>|int|false', 'string'=>'string', 'format='=>'int', 'charlist='=>'string'],
'strcasecmp' => ['int', 'str1'=>'string', 'str2'=>'string'],
'strchr' => ['string|false', 'haystack'=>'string', 'needle'=>'string', 'before_needle='=>'bool'],
Expand Down
2 changes: 1 addition & 1 deletion resources/functionMap_php74delta.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
'FFI::typeof' => ['FFI\CType', '&ptr'=>'FFI\CData'],
'FFI::type' => ['FFI\CType', 'type'=>'string'],
'get_mangled_object_vars' => ['array', 'obj'=>'object'],
'mb_str_split' => ['array<int,string>|false', 'str'=>'string', 'split_length='=>'positive-int', 'encoding='=>'string'],
'mb_str_split' => ['array<int,string>|false', 'str'=>'string', 'split_length='=>'int', 'encoding='=>'string'],
'password_algos' => ['array<int, string>'],
'password_hash' => ['string|false', 'password'=>'string', 'algo'=>'string|null', 'options='=>'array'],
'password_needs_rehash' => ['bool', 'hash'=>'string', 'algo'=>'string|null', 'options='=>'array'],
Expand Down

1 comment on commit 119facc

@ondrejmirtes
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/cc @staabm It's kind of annoying to break people's builds on PHP 7.x because of this, so I added it only to PHP 8 where these functions throw an exception.

Please sign in to comment.