3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $bar = null; $array = array( 'foo', 'bar', '', null, 0, $bar ); var_dump(array_values($array)); $array = array( 'foo' => 'foo', 'bar' => 'bar', 'baz' => '', 'null' => null, 'zero' => 0, 'var' => $bar ); var_dump(array_values($array)); var_dump(array_keys($array));
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
array(6) { [0]=> string(3) "foo" [1]=> string(3) "bar" [2]=> string(0) "" [3]=> NULL [4]=> int(0) [5]=> NULL } array(6) { [0]=> string(3) "foo" [1]=> string(3) "bar" [2]=> string(0) "" [3]=> NULL [4]=> int(0) [5]=> NULL } array(6) { [0]=> string(3) "foo" [1]=> string(3) "bar" [2]=> string(3) "baz" [3]=> string(4) "null" [4]=> string(4) "zero" [5]=> string(3) "var" }