3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $array = array( 'string' => '!@#$%^&*()_+~`1234567890-=\'"\\/?', 'array' => array( 'test' ), 'int' => 1, 'double' => 1.25, 'boolean' => true ); $first_level = $array; $current_level =& $array; for($i = 10;$i--;) { $current_level['depth_test'] = $first_level; $current_level =& $current_level['depth_test']; } var_dump($array);
Output for 5.2.1 - 7.1.0
array(6) { ["string"]=> string(31) "!@#$%^&*()_+~`1234567890-='"\/?" ["array"]=> array(1) { [0]=> string(4) "test" } ["int"]=> int(1) ["double"]=> float(1.25) ["boolean"]=> bool(true) ["depth_test"]=> array(6) { ["string"]=> string(31) "!@#$%^&*()_+~`1234567890-='"\/?" ["array"]=> array(1) { [0]=> string(4) "test" } ["int"]=> int(1) ["double"]=> float(1.25) ["boolean"]=> bool(true) ["depth_test"]=> array(6) { ["string"]=> string(31) "!@#$%^&*()_+~`1234567890-='"\/?" ["array"]=> array(1) { [0]=> string(4) "test" } ["int"]=> int(1) ["double"]=> float(1.25) ["boolean"]=> bool(true) ["depth_test"]=> array(6) { ["string"]=> string(31) "!@#$%^&*()_+~`1234567890-='"\/?" ["array"]=> array(1) { [0]=> string(4) "test" } ["int"]=> int(1) ["double"]=> float(1.25) ["boolean"]=> bool(true) ["depth_test"]=> array(6) { ["string"]=> string(31) "!@#$%^&*()_+~`1234567890-='"\/?" ["array"]=> array(1) { [0]=> string(4) "test" } ["int"]=> int(1) ["double"]=> float(1.25) ["boolean"]=> bool(true) ["depth_test"]=> array(6) { ["string"]=> string(31) "!@#$%^&*()_+~`1234567890-='"\/?" ["array"]=> array(1) { [0]=> string(4) "test" } ["int"]=> int(1) ["double"]=> float(1.25) ["boolean"]=> bool(true) ["depth_test"]=> array(6) { ["string"]=> string(31) "!@#$%^&*()_+~`1234567890-='"\/?" ["array"]=> array(1) { [0]=> string(4) "test" } ["int"]=> int(1) ["double"]=> float(1.25) ["boolean"]=> bool(true) ["depth_test"]=> array(6) { ["string"]=> string(31) "!@#$%^&*()_+~`1234567890-='"\/?" ["array"]=> array(1) { [0]=> string(4) "test" } ["int"]=> int(1) ["double"]=> float(1.25) ["boolean"]=> bool(true) ["depth_test"]=> array(6) { ["string"]=> string(31) "!@#$%^&*()_+~`1234567890-='"\/?" ["array"]=> array(1) { [0]=> string(4) "test" } ["int"]=> int(1) ["double"]=> float(1.25) ["boolean"]=> bool(true) ["depth_test"]=> array(6) { ["string"]=> string(31) "!@#$%^&*()_+~`1234567890-='"\/?" ["array"]=> array(1) { [0]=> string(4) "test" } ["int"]=> int(1) ["double"]=> float(1.25) ["boolean"]=> bool(true) ["depth_test"]=> &array(5) { ["string"]=> string(31) "!@#$%^&*()_+~`1234567890-='"\/?" ["array"]=> array(1) { [0]=> string(4) "test" } ["int"]=> int(1) ["double"]=> float(1.25) ["boolean"]=> bool(true) } } } } } } } } } } }
Output for 4.3.0 - 5.2.0
array(6) { ["string"]=> string(31) "!@#$%^&*()_+~`1234567890-='"\/?" ["array"]=> array(1) { [0]=> string(4) "test" } ["int"]=> int(1) ["double"]=> float(1.25) ["boolean"]=> bool(true) ["depth_test"]=> &array(6) { ["string"]=> string(31) "!@#$%^&*()_+~`1234567890-='"\/?" ["array"]=> array(1) { [0]=> string(4) "test" } ["int"]=> int(1) ["double"]=> float(1.25) ["boolean"]=> bool(true) ["depth_test"]=> &array(6) { ["string"]=> string(31) "!@#$%^&*()_+~`1234567890-='"\/?" ["array"]=> array(1) { [0]=> string(4) "test" } ["int"]=> int(1) ["double"]=> float(1.25) ["boolean"]=> bool(true) ["depth_test"]=> &array(6) { ["string"]=> string(31) "!@#$%^&*()_+~`1234567890-='"\/?" ["array"]=> array(1) { [0]=> string(4) "test" } ["int"]=> int(1) ["double"]=> float(1.25) ["boolean"]=> bool(true) ["depth_test"]=> &array(6) { ["string"]=> string(31) "!@#$%^&*()_+~`1234567890-='"\/?" ["array"]=> array(1) { [0]=> string(4) "test" } ["int"]=> int(1) ["double"]=> float(1.25) ["boolean"]=> bool(true) ["depth_test"]=> &array(6) { ["string"]=> string(31) "!@#$%^&*()_+~`1234567890-='"\/?" ["array"]=> array(1) { [0]=> string(4) "test" } ["int"]=> int(1) ["double"]=> float(1.25) ["boolean"]=> bool(true) ["depth_test"]=> &array(6) { ["string"]=> string(31) "!@#$%^&*()_+~`1234567890-='"\/?" ["array"]=> array(1) { [0]=> string(4) "test" } ["int"]=> int(1) ["double"]=> float(1.25) ["boolean"]=> bool(true) ["depth_test"]=> &array(6) { ["string"]=> string(31) "!@#$%^&*()_+~`1234567890-='"\/?" ["array"]=> array(1) { [0]=> string(4) "test" } ["int"]=> int(1) ["double"]=> float(1.25) ["boolean"]=> bool(true) ["depth_test"]=> &array(6) { ["string"]=> string(31) "!@#$%^&*()_+~`1234567890-='"\/?" ["array"]=> array(1) { [0]=> string(4) "test" } ["int"]=> int(1) ["double"]=> float(1.25) ["boolean"]=> bool(true) ["depth_test"]=> &array(6) { ["string"]=> string(31) "!@#$%^&*()_+~`1234567890-='"\/?" ["array"]=> array(1) { [0]=> string(4) "test" } ["int"]=> int(1) ["double"]=> float(1.25) ["boolean"]=> bool(true) ["depth_test"]=> &array(5) { ["string"]=> string(31) "!@#$%^&*()_+~`1234567890-='"\/?" ["array"]=> array(1) { [0]=> string(4) "test" } ["int"]=> int(1) ["double"]=> float(1.25) ["boolean"]=> bool(true) } } } } } } } } } } }