3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php # 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);
Output for 5.6.0 - 5.6.26, hhvm-3.15.4, 7.0.0 - 7.0.11, 7.3.0alpha1
A Object ( [prop] => Array ( [0] => 1 [1] => 2 [2] => 3 ) ) C Object ( [prop] => Array ( [0] => string [1] => string2 ) )
Output for 5.6.27 - 5.6.30, 7.0.12 - 7.2.6
A Object ( [prop] => Array *RECURSION* ) C Object ( [prop] => Array *RECURSION* )