From 58140009e5fa910d480a6a48e6e756fc1bb4cf94 Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Thu, 28 Sep 2017 23:14:26 +0000 Subject: [PATCH] Build/Test tools: Update the `WP_PHPUnit_Util_Getopt` class for PHP 7.2 compatibility. This removes usage of `each()` which is deprecated in PHP 7.2. Props ayeshrajans See #40109 Fixes #41525 git-svn-id: https://develop.svn.wordpress.org/trunk@41636 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/includes/bootstrap.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/phpunit/includes/bootstrap.php b/tests/phpunit/includes/bootstrap.php index 1450736fd1..2bb428d74c 100644 --- a/tests/phpunit/includes/bootstrap.php +++ b/tests/phpunit/includes/bootstrap.php @@ -132,7 +132,9 @@ class WP_PHPUnit_Util_Getopt extends PHPUnit_Util_Getopt { function __construct( $argv ) { array_shift( $argv ); $options = array(); - while ( list( $i, $arg ) = each( $argv ) ) { + while ( current( $argv ) ) { + $arg = current( $argv ); + next( $argv ); try { if ( strlen( $arg ) > 1 && $arg[0] === '-' && $arg[1] === '-' ) { PHPUnit_Util_Getopt::parseLongOption( substr( $arg, 2 ), $this->longOptions, $options, $argv );