3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $x = array( 'x' => '1x', 'y' => 'fgd', 'z' => 'fd', 'f' =>'fg' ); $y = array_keys( $x ); echo debug_zval_dump( $x ); echo "\n"; echo debug_zval_dump( $y );
Output for 7.1.0
array(4) refcount(3){ ["x"]=> string(2) "1x" refcount(1) ["y"]=> string(3) "fgd" refcount(1) ["z"]=> string(2) "fd" refcount(1) ["f"]=> string(2) "fg" refcount(1) } array(4) refcount(2){ [0]=> string(1) "x" refcount(2) [1]=> string(1) "y" refcount(2) [2]=> string(1) "z" refcount(2) [3]=> string(1) "f" refcount(2) }
Output for 7.0.0 - 7.0.14
array(4) refcount(2){ ["x"]=> string(2) "1x" refcount(2) ["y"]=> string(3) "fgd" refcount(2) ["z"]=> string(2) "fd" refcount(2) ["f"]=> string(2) "fg" refcount(2) } array(4) refcount(2){ [0]=> string(1) "x" refcount(3) [1]=> string(1) "y" refcount(3) [2]=> string(1) "z" refcount(3) [3]=> string(1) "f" refcount(3) }
Output for 4.3.0 - 5.6.25
array(4) refcount(2){ ["x"]=> string(2) "1x" refcount(1) ["y"]=> string(3) "fgd" refcount(1) ["z"]=> string(2) "fd" refcount(1) ["f"]=> string(2) "fg" refcount(1) } array(4) refcount(2){ [0]=> string(1) "x" refcount(1) [1]=> string(1) "y" refcount(1) [2]=> string(1) "z" refcount(1) [3]=> string(1) "f" refcount(1) }