From 918bebfe3c5850715bb1787dd37c86f80c0536de Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sun, 18 Oct 2020 06:27:38 +0000 Subject: [PATCH] Code Modernization: Remove unnecessary reference sign from `PO::export_entry()` definition. This fixes a PHP 8 "argument must be passed by reference, value given" error when using `array_map()` in `PO::export_entries()`. Object variables in PHP 5+ contain a reference to the object, and it's the reference that's passed around. Props jrf. See #50913. git-svn-id: https://develop.svn.wordpress.org/trunk@49186 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/pomo/po.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wp-includes/pomo/po.php b/src/wp-includes/pomo/po.php index b2a605a3ec..99bb6891b1 100644 --- a/src/wp-includes/pomo/po.php +++ b/src/wp-includes/pomo/po.php @@ -212,11 +212,11 @@ if ( ! class_exists( 'PO', false ) ) : /** * Builds a string from the entry for inclusion in PO file * - * @param Translation_Entry $entry the entry to convert to po string (passed by reference). + * @param Translation_Entry $entry the entry to convert to po string. * @return string|false PO-style formatted string for the entry or * false if the entry is empty */ - public static function export_entry( &$entry ) { + public static function export_entry( $entry ) { if ( null === $entry->singular || '' === $entry->singular ) { return false; }