Skip to content

Commit

Permalink
Merge pull request #9832 from kamil-tekiela/base64_decode
Browse files Browse the repository at this point in the history
base64_decode returns false only in strict mode
  • Loading branch information
orklah committed May 29, 2023
2 parents 106b986 + c2bbc62 commit eedea6b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion dictionaries/CallMap.php
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,8 @@
'BadMethodCallException::getPrevious' => ['?Throwable'],
'BadMethodCallException::getTrace' => ['list<array{file?:string,line?:int,function:string,class?:class-string,type?:\'::\'|\'->\',args?:array<mixed>}>'],
'BadMethodCallException::getTraceAsString' => ['string'],
'base64_decode' => ['string|false', 'string'=>'string', 'strict='=>'bool'],
'base64_decode' => ['string', 'string'=>'string', 'strict='=>'false'],
'base64_decode\'1' => ['string|false', 'string'=>'string', 'strict='=>'true'],
'base64_encode' => ['string', 'string'=>'string'],
'base_convert' => ['string', 'num'=>'string', 'from_base'=>'int', 'to_base'=>'int'],
'basename' => ['string', 'path'=>'string', 'suffix='=>'string'],
Expand Down
3 changes: 2 additions & 1 deletion dictionaries/CallMap_historical.php
Original file line number Diff line number Diff line change
Expand Up @@ -9404,7 +9404,8 @@
'atan' => ['float', 'num'=>'float'],
'atan2' => ['float', 'y'=>'float', 'x'=>'float'],
'atanh' => ['float', 'num'=>'float'],
'base64_decode' => ['string|false', 'string'=>'string', 'strict='=>'bool'],
'base64_decode' => ['string', 'string'=>'string', 'strict='=>'false'],
'base64_decode\'1' => ['string|false', 'string'=>'string', 'strict='=>'true'],
'base64_encode' => ['string', 'string'=>'string'],
'base_convert' => ['string', 'num'=>'string', 'from_base'=>'int', 'to_base'=>'int'],
'basename' => ['string', 'path'=>'string', 'suffix='=>'string'],
Expand Down
3 changes: 3 additions & 0 deletions stubs/CoreGenericFunctions.phpstub
Original file line number Diff line number Diff line change
Expand Up @@ -1559,7 +1559,10 @@ function unpack(string $format, string $string, int $offset = 0) {}
/**
* @psalm-pure
*
* @template T of bool
* @param T $strict
* @return string|false
* @psalm-return (T is false ? string : string|false)
*
* @psalm-flow ($string) -> return
* @psalm-ignore-falsable-return
Expand Down

0 comments on commit eedea6b

Please sign in to comment.