Skip to content

Commit

Permalink
WP 6.5: account for new function polyfills
Browse files Browse the repository at this point in the history
WP 6.5 contains a polyfill for `array_is_list`, which was introduced in PHP 8.1
  • Loading branch information
swissspidy committed Feb 5, 2024
1 parent 02e4bf7 commit 6904657
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions PHPCompatibilityWP/ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
* str_contains(): since WP 5.9.0
* str_starts_with(): since WP 5.9.0
* str_ends_with(): since WP 5.9.0
* array_is_list(): since WP 6.5.0
-->
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.hash_hmacFound"/>
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.json_encodeFound"/>
Expand All @@ -51,6 +52,7 @@
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.str_containsFound"/>
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.str_starts_withFound"/>
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.str_ends_withFound"/>
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.array_is_listFound"/>

<!--
Contained in /wp-includes/spl-autoload-compat.php.
Expand Down
2 changes: 2 additions & 0 deletions Test/WPTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,5 @@ class ABC implements JsonSerializable {}
$a = str_ends_with( $haystack, $needle );

echo IMAGETYPE_WEBP, IMG_WEBP;

if (array_is_list($array)) {}

0 comments on commit 6904657

Please sign in to comment.