3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php echo "*** using correct value ***\n\n"; $Array = unserialize('a:2:{s:1:"a";i:1;s:1:"b";R:1;}'); echo "print_r():\n"; echo "----------\n"; print_r($Array); echo "\n"; $Array['a'] = 2; var_dump($Array['b']); //$Array['b']['a'] = 2; echo "print_r():\n"; echo "----------\n"; print_r($Array); echo "\n";
Output for 7.0.0 - 7.2.6
*** using correct value *** print_r(): ---------- Array ( [a] => 1 [b] => Array *RECURSION* ) array(2) { ["a"]=> int(1) ["b"]=> &array(2) { ["a"]=> int(1) ["b"]=> *RECURSION* } } print_r(): ---------- Array ( [a] => 2 [b] => Array ( [a] => 1 [b] => Array *RECURSION* ) )
Output for 5.6.7 - 5.6.21
*** using correct value *** print_r(): ---------- Array ( [a] => 1 [b] => Array ( [a] => 1 [b] => Array *RECURSION* ) ) array(2) { ["a"]=> int(1) ["b"]=> &array(2) { ["a"]=> int(1) ["b"]=> *RECURSION* } } print_r(): ---------- Array ( [a] => 2 [b] => Array ( [a] => 1 [b] => Array *RECURSION* ) )
Output for 5.2.14 - 5.2.17, 5.3.3 - 5.5.35
*** using correct value *** print_r(): ---------- Array ( [a] => 1 [b] => Array *RECURSION* ) array(2) { ["a"]=> int(1) ["b"]=> *RECURSION* } print_r(): ---------- Array ( [a] => 2 [b] => Array ( [a] => 1 [b] => Array *RECURSION* ) )
Output for 5.1.0 - 5.2.13, 5.3.0 - 5.3.2
*** using correct value *** print_r(): ---------- Array ( [a] => 1 [b] => Array *RECURSION* ) array(2) { ["a"]=> int(1) ["b"]=> array(2) { ["a"]=> int(1) ["b"]=> *RECURSION* } } print_r(): ---------- Array ( [a] => 2 [b] => Array ( [a] => 1 [b] => Array *RECURSION* ) )
Output for 4.3.0 - 5.0.5
*** using correct value *** print_r(): ---------- Array ( [a] => 1 [b] => Array *RECURSION* ) array(2) { ["a"]=> int(2) ["b"]=> array(2) { ["a"]=> int(2) ["b"]=> *RECURSION* } } print_r(): ---------- Array ( [a] => 2 [b] => Array *RECURSION* )