vsninternet Posted May 7, 2022 Share Posted May 7, 2022 Hi, Who can help me make these code working whitout warnings? It is a file from Redis PHP Rescue PHP Deprecated: implode(): Passing glue string after array is deprecated. Swap the parameters in /public_html/vendor/chrisboulton/php-resque/lib/Redisent/Redisent.php on line 73 Here is the code /* Build the Redis unified protocol command */ array_unshift($args, strtoupper($name)); $command = sprintf('*%d%s%s%s', count($args), CRLF, implode(array_map(array($this, 'formatArgument'), $args), CRLF), CRLF); Kind regards Quote Link to comment https://forums.phpfreaks.com/topic/314767-php-deprecated-implode-passing-glue-string-after-array-is-deprecated/ Share on other sites More sharing options...
Barand Posted May 7, 2022 Share Posted May 7, 2022 6 minutes ago, vsninternet said: Passing glue string after array is deprecated. Swap the parameters The clue is in the message. Read and do as it says. Quote Link to comment https://forums.phpfreaks.com/topic/314767-php-deprecated-implode-passing-glue-string-after-array-is-deprecated/#findComment-1596015 Share on other sites More sharing options...
vsninternet Posted May 7, 2022 Author Share Posted May 7, 2022 I understand, but unfortunatly i am not yet good in the lanquage. So would it simply be as this? implode(array_map(array($this, 'formatArgument'), $args), CRLF), CRLF); Changed to? $args), implode(array_map(array($this, 'formatArgument'); Or $args), , CRLF), CRLF), implode(array_map(array($this, 'formatArgument'), CRLF), CRLF); Quote Link to comment https://forums.phpfreaks.com/topic/314767-php-deprecated-implode-passing-glue-string-after-array-is-deprecated/#findComment-1596016 Share on other sites More sharing options...
Barand Posted May 7, 2022 Share Posted May 7, 2022 (edited) php.net/mplode Edited May 7, 2022 by Barand Quote Link to comment https://forums.phpfreaks.com/topic/314767-php-deprecated-implode-passing-glue-string-after-array-is-deprecated/#findComment-1596017 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.