From 19df309491e6931a9f45c1d36f854b74ab92116e Mon Sep 17 00:00:00 2001 From: Boone Gorges Date: Fri, 2 Oct 2015 13:50:04 +0000 Subject: [PATCH] Fix `preg_match_all()` syntax in PCRE benchmark test util. In versions of PHP earlier than 5.4, the `$matches` parameter was required. Excluding it here meant that PCRE benchmarking tests were erroring on older versions of PHP without cleaning up the PCRE ini settings, causing various problems on later tests. Props miqrogroove, dd32, boonebgorges. And to the cosmic forces that cause bugs like this. The best part of waking up is diagnosing leakage between automated tests. See #34121. git-svn-id: https://develop.svn.wordpress.org/trunk@34772 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/includes/utils.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/phpunit/includes/utils.php b/tests/phpunit/includes/utils.php index 0696c5b4ac..e95323a2e0 100644 --- a/tests/phpunit/includes/utils.php +++ b/tests/phpunit/includes/utils.php @@ -419,7 +419,8 @@ function benchmark_pcre_backtracking( $pattern, $subject, $strategy ) { preg_match( $pattern, $subject ); break; case 'match_all': - preg_match_all( $pattern, $subject ); + $matches = array(); + preg_match_all( $pattern, $subject, $matches ); break; }