Skip to content

Commit

Permalink
Merge pull request #8416 from kkmuffme/regression-4.25.0-count-resour…
Browse files Browse the repository at this point in the history
…cebundle

fix crash in <PHP8 with ResourceBundle
  • Loading branch information
orklah committed Sep 23, 2022
2 parents ebabd4b + 328561d commit b55fc2b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dictionaries/CallMap_80_delta.php
Expand Up @@ -214,7 +214,7 @@
'new' => ['bool', 'typelib_name'=>'string', 'case_insensitive='=>'true'],
],
'count' => [
'old' => ['int', 'value'=>'Countable|array|SimpleXMLElement|ResourceBundle', 'mode='=>'int'],
'old' => ['int', 'value'=>'Countable|array|SimpleXMLElement', 'mode='=>'int'],
'new' => ['int', 'value'=>'Countable|array', 'mode='=>'int'],
],
'count_chars' => [
Expand Down
2 changes: 1 addition & 1 deletion dictionaries/CallMap_historical.php
Expand Up @@ -10085,7 +10085,7 @@
'copy' => ['bool', 'from'=>'string', 'to'=>'string', 'context='=>'resource'],
'cos' => ['float', 'num'=>'float'],
'cosh' => ['float', 'num'=>'float'],
'count' => ['int', 'value'=>'Countable|array|SimpleXMLElement|ResourceBundle', 'mode='=>'int'],
'count' => ['int', 'value'=>'Countable|array|SimpleXMLElement', 'mode='=>'int'],
'count_chars' => ['array<int,int>|false', 'input'=>'string', 'mode='=>'0|1|2'],
'count_chars\'1' => ['string|false', 'input'=>'string', 'mode='=>'3|4'],
'crack_check' => ['bool', 'dictionary'=>'', 'password'=>'string'],
Expand Down
8 changes: 7 additions & 1 deletion tests/Internal/Codebase/InternalCallMapHandlerTest.php
Expand Up @@ -519,7 +519,13 @@ public function testIgnoresAreSortedAndUnique(): void
/** @var string */
$function = is_int($key) ? $value : $key;

$this->assertGreaterThan(0, strcmp($function, $previousFunction));
$diff = strcmp($function, $previousFunction);
if ($diff <= 0) {
// faster debugging errors in tests
echo "\n" . $previousFunction . "\n" . $function . "\n";
}

$this->assertGreaterThan(0, $diff);
$previousFunction = $function;
}
}
Expand Down

0 comments on commit b55fc2b

Please sign in to comment.