3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $iWannaUseThePikey = array( // Look ma, it's an array 'foo' => '1', 'bar' => '2', 'baz' => '3', 'zip' => '1'); // This throws type warnings all over the place - no Timmy, it's not an array $boris = array_count_values($iWannaUseThePikey); // This doesn't. Let's cast the array to an array just to make sure... oh ok now it's an array $avi = array_count_values((array)$iWannaUseThePikey); var_dump($boris); var_dump($avi);
Output for 4.3.0 - 4.4.9, 5.0.2 - 5.6.28, hhvm-3.12.0, 7.0.0 - 7.1.0
array(3) { [1]=> int(2) [2]=> int(1) [3]=> int(1) } array(3) { [1]=> int(2) [2]=> int(1) [3]=> int(1) }
Output for hhvm-3.10.0

Process exited with code 153.
Output for 5.0.0 - 5.0.1
array(3) { ["1"]=> int(2) ["2"]=> int(1) ["3"]=> int(1) } array(3) { ["1"]=> int(2) ["2"]=> int(1) ["3"]=> int(1) }