|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull Requests |
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2018 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 19 01:31:42 2017 UTC |
Description: ------------ If we apply mb_convert_variables on class which have array properties next created object of this class have been corrupted default value of array properties. Also if we set property of another class by object of 1st class and apply mb_convert_variables on 2nd class next created object of 1st class have been corrupted values of array properties too. Test script: --------------- # example 1 class A { public $prop = [1,2,3]; } class B{ public $someProp; } $a = new A; $b = new B; $b->someProp = $a->prop; mb_convert_variables('UTF-8', 'CP1252', $b); $a = new A; print_r($a); # example 2 class C { public $prop = ['string', 'string2']; } $c = new C; mb_convert_variables('UTF-8', 'CP1252', $c); $c = new C; print_r($c); Expected result: ---------------- A Object ( [prop] => Array ( [0] => 1 [1] => 2 [2] => 3 ) ) C Object ( [prop] => Array ( [0] => string [1] => string2 ) ) Actual result: -------------- A Object ( [prop] => Array *RECURSION* ) C Object ( [prop] => Array *RECURSION* )