3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $grades=array(-4,-1,0,1,6,10,70,99,100,101,105,110); foreach($grades as $grade){ if( $grade<0 || $grade>100 ){ $validGrades[] = $grade; }else{ $invalidGrades[] = $grade; } } var_export($validGrades); echo "\n---\n"; var_export($invalidGrades);
based on ItH2f
Output for 5.6.0 - 5.6.30, hhvm-3.18.5 - 3.22.0, 7.0.0 - 7.3.0beta1
array ( 0 => -4, 1 => -1, 2 => 101, 3 => 105, 4 => 110, ) --- array ( 0 => 0, 1 => 1, 2 => 6, 3 => 10, 4 => 70, 5 => 99, 6 => 100, )