Skip to content

Commit d564e4e

Browse files
Tests: Use the null coalescing operators in the test suite.
Replaces `isset()` and `array_key_exists()` ternaries that return the tested value or a fallback of `null` or `''` with the null coalescing operator (`??`), and self-referencing `$x = $x ?? $y` assignments with the null coalescing assignment operator (`??=`). **Why this is safe** - `??` and `isset()` test the same condition, so the fallback is used in exactly the same cases. - `array_key_exists()` and `??` only differ for a key that exists with a `null` value. Every converted `array_key_exists()` site falls back to `null`, so both forms return `null` in that case as well. - `??=` requires PHP 7.4, which is already the minimum supported version. - No behavior change; this is test-only code. Developed in WordPress/wordpress-develop#14616. Follow-up to r63609, r63633. Props Soean, huzaifaalmesbah. See #65819. Built from https://develop.svn.wordpress.org/trunk@64675 git-svn-id: http://core.svn.wordpress.org/trunk@63825 1a063a9b-81f0-0310-95a4-ce76da25c4cd
1 parent 4ee9bdf commit d564e4e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎wp-includes/version.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*
1717
* @global string $wp_version
1818
*/
19-
$wp_version = '7.2-beta1-64674';
19+
$wp_version = '7.2-beta1-64675';
2020

2121
/**
2222
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.

0 commit comments

Comments
 (0)