3v4l.org

run code in 200+ 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($array); var_dump($counts); $unique = array_unique($arr, SORT_REGULAR); //$newArray = array_fill(0, $counts['apple']-2, 'apple');
Output for 5.3.0 - 7.2.0
Notice: Undefined variable: array in /in/QDuL1 on line 11 Warning: array_count_values() expects parameter 1 to be array, null given in /in/QDuL1 on line 11 NULL
Output for 5.2.9 - 5.2.17
Notice: Undefined variable: array in /in/QDuL1 on line 11 Warning: array_count_values(): The argument should be an array in /in/QDuL1 on line 11 NULL
Output for 5.0.4 - 5.0.5, 5.1.1 - 5.2.8
Notice: Undefined variable: array in /in/QDuL1 on line 11 Warning: array_count_values(): The argument should be an array in /in/QDuL1 on line 11 NULL Warning: Wrong parameter count for array_unique() in /in/QDuL1 on line 14
Output for 5.1.0
Fatal error: fatal flex scanner internal error--end of buffer missed in /in/QDuL1 on line 15
Process exited with code 255.
Output for 4.3.2 - 5.0.3
Notice: Undefined variable: array in /in/QDuL1 on line 11 Warning: array_count_values(): The argument should be an array in /in/QDuL1 on line 11 NULL Warning: Wrong parameter count for array_unique() in /in/QDuL1 on line 14
Output for 4.3.0 - 4.3.1
Notice: Undefined variable: array in /in/QDuL1 on line 11 Warning: array_count_values() [http://www.php.net/function.array-count-values]: The argument should be an array in /in/QDuL1 on line 11 NULL Warning: Wrong parameter count for array_unique() in /in/QDuL1 on line 14