3v4l.org

run code in 300+ PHP versions simultaneously
<?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 8.1.0 - 8.1.27, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
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" interned [1]=> string(1) "y" interned [2]=> string(1) "z" interned [3]=> string(1) "f" interned }
Output for 7.3.12 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30
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(1) [1]=> string(1) "y" refcount(1) [2]=> string(1) "z" refcount(1) [3]=> string(1) "f" refcount(1) }
Output for 7.1.0 - 7.1.20, 7.2.0 - 7.2.33
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.20
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 - 4.3.11, 4.4.0 - 4.4.9, 5.0.0 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.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) }

preferences:
236 ms | 404 KiB | 354 Q