|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2020-01-22 09:17 UTC] cmb@php.net
-Assigned To:
+Assigned To: cmb
[2020-01-22 09:33 UTC] cmb@php.net
[2020-01-22 09:33 UTC] cmb@php.net
-Status: Assigned
+Status: Closed
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 22:00:01 2025 UTC |
Description: ------------ If an array containing values which are not strings is passed as $from_encoding to mb_convert_encoding(), the array is modified although it is not passed by reference. This issue is fixed as of PHP 7.4.0. Test script: --------------- <?php class Utf8Encoding { public function __toString() { return 'UTF-8'; } } $utf8encoding = new Utf8Encoding(); $encodings = [$utf8encoding]; var_dump($encodings); mb_convert_encoding('foo', 'UTF-8', $encodings); var_dump($encodings); ?> Expected result: ---------------- array(1) { [0]=> object(Utf8Encoding)#1 (0) { } } array(1) { [0]=> object(Utf8Encoding)#1 (0) { } } Actual result: -------------- array(1) { [0]=> object(Utf8Encoding)#1 (0) { } } array(1) { [0]=> string(5) "UTF-8" }