3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $words = array('systematic', 'سلام','gear','synthesis','mysterious'); $letters=array('s','m', 'e'); foreach ($words as $w) { //print "lets check word $w<br>"; $n=0; foreach ($letters as $l) { if (strpos($w, $l)!==false) $n++; } if ($n>= array_count_values($l,'utf8')) print "$w<br/>".array_count_values($l,'utf8')."==="; }
Output for 5.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Warning: array_count_values() expects exactly 1 parameter, 2 given in /in/Jfhdf on line 10 Warning: array_count_values() expects exactly 1 parameter, 2 given in /in/Jfhdf on line 10 systematic<br/>=== Warning: array_count_values() expects exactly 1 parameter, 2 given in /in/Jfhdf on line 10 Warning: array_count_values() expects exactly 1 parameter, 2 given in /in/Jfhdf on line 10 سلام<br/>=== Warning: array_count_values() expects exactly 1 parameter, 2 given in /in/Jfhdf on line 10 Warning: array_count_values() expects exactly 1 parameter, 2 given in /in/Jfhdf on line 10 gear<br/>=== Warning: array_count_values() expects exactly 1 parameter, 2 given in /in/Jfhdf on line 10 Warning: array_count_values() expects exactly 1 parameter, 2 given in /in/Jfhdf on line 10 synthesis<br/>=== Warning: array_count_values() expects exactly 1 parameter, 2 given in /in/Jfhdf on line 10 Warning: array_count_values() expects exactly 1 parameter, 2 given in /in/Jfhdf on line 10 mysterious<br/>===
Output for 4.3.0 - 5.2.17
Warning: Wrong parameter count for array_count_values() in /in/Jfhdf on line 10 Warning: Wrong parameter count for array_count_values() in /in/Jfhdf on line 10 systematic<br/>=== Warning: Wrong parameter count for array_count_values() in /in/Jfhdf on line 10 Warning: Wrong parameter count for array_count_values() in /in/Jfhdf on line 10 سلام<br/>=== Warning: Wrong parameter count for array_count_values() in /in/Jfhdf on line 10 Warning: Wrong parameter count for array_count_values() in /in/Jfhdf on line 10 gear<br/>=== Warning: Wrong parameter count for array_count_values() in /in/Jfhdf on line 10 Warning: Wrong parameter count for array_count_values() in /in/Jfhdf on line 10 synthesis<br/>=== Warning: Wrong parameter count for array_count_values() in /in/Jfhdf on line 10 Warning: Wrong parameter count for array_count_values() in /in/Jfhdf on line 10 mysterious<br/>===