3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $original = [ ['name' => 'Barfoo'], ['name' => 'Foobar'], ['name' => 'Foobar'], ['name' => 'Foo'], ]; $keyMap = []; var_dump(array_count_values($original));die; foreach ($original as $key => $item) { var_dump(array_search()); }
based on YUBZh
Output for 5.6.0 - 5.6.30, 7.0.0 - 7.3.0beta1
Warning: array_count_values(): Can only count STRING and INTEGER values! in /in/JWtK8 on line 12 Warning: array_count_values(): Can only count STRING and INTEGER values! in /in/JWtK8 on line 12 Warning: array_count_values(): Can only count STRING and INTEGER values! in /in/JWtK8 on line 12 Warning: array_count_values(): Can only count STRING and INTEGER values! in /in/JWtK8 on line 12 array(0) { }
Output for hhvm-3.22.0
Warning: Can only count STRING and INTEGER values! in /in/JWtK8 on line -1 Warning: Can only count STRING and INTEGER values! in /in/JWtK8 on line -1 Warning: Can only count STRING and INTEGER values! in /in/JWtK8 on line -1 Warning: Can only count STRING and INTEGER values! in /in/JWtK8 on line -1 array(0) { }
Output for hhvm-3.18.5 - 3.21.3
Warning: Can only count STRING and INTEGER values! in /in/JWtK8 on line 12 Warning: Can only count STRING and INTEGER values! in /in/JWtK8 on line 12 Warning: Can only count STRING and INTEGER values! in /in/JWtK8 on line 12 Warning: Can only count STRING and INTEGER values! in /in/JWtK8 on line 12 array(0) { }