3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $arr = array( array('status'=>'OK','Productname'=>'test1'), array('status'=>'OK','Productname'=>'test1'), array('status'=>'OK','Productname'=>'test2'), array('status'=>'OK','Productname'=>'test2') ); $notToDuplicate = array('test1'); $counts = array_count_values($arr); var_dump($counts); $unique = array_unique($arr, SORT_REGULAR); //$newArray = array_fill(0, $counts['apple']-2, 'apple');
Output for 5.2.9 - 7.1.0
Warning: array_count_values(): Can only count STRING and INTEGER values! in /in/stJ0S on line 11 Warning: array_count_values(): Can only count STRING and INTEGER values! in /in/stJ0S on line 11 Warning: array_count_values(): Can only count STRING and INTEGER values! in /in/stJ0S on line 11 Warning: array_count_values(): Can only count STRING and INTEGER values! in /in/stJ0S on line 11 array(0) { }
Output for 4.3.2 - 5.0.5, 5.1.1 - 5.2.8
Warning: array_count_values(): Can only count STRING and INTEGER values! in /in/stJ0S on line 11 Warning: array_count_values(): Can only count STRING and INTEGER values! in /in/stJ0S on line 11 Warning: array_count_values(): Can only count STRING and INTEGER values! in /in/stJ0S on line 11 Warning: array_count_values(): Can only count STRING and INTEGER values! in /in/stJ0S on line 11 array(0) { } Warning: Wrong parameter count for array_unique() in /in/stJ0S on line 14
Output for 5.1.0
Fatal error: fatal flex scanner internal error--end of buffer missed in /in/stJ0S on line 15
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Warning: array_count_values() [http://www.php.net/function.array-count-values]: Can only count STRING and INTEGER values! in /in/stJ0S on line 11 Warning: array_count_values() [http://www.php.net/function.array-count-values]: Can only count STRING and INTEGER values! in /in/stJ0S on line 11 Warning: array_count_values() [http://www.php.net/function.array-count-values]: Can only count STRING and INTEGER values! in /in/stJ0S on line 11 Warning: array_count_values() [http://www.php.net/function.array-count-values]: Can only count STRING and INTEGER values! in /in/stJ0S on line 11 array(0) { } Warning: Wrong parameter count for array_unique() in /in/stJ0S on line 14