3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $cups = array(); for($i=0; $i<100; $i++){ $cups[$i] = 0; } for($x=1; $x<100; $x++){ for($y=$x; $y<100; $y+=$x){ $cups[$y] = !$cups[$y]; } } $selected = array(); foreach($cups as $key => $value){ if($value == 1){ $selected[] = $key; } } $sel_str = implode(', ', $selected); echo $sel_str; echo "\n\n\n\n"; foreach ($selected as $num) { settype($num, 'integer'); echo decbin($num)."\n"; }
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
1, 4, 9, 16, 25, 36, 49, 64, 81 1 100 1001 10000 11001 100100 110001 1000000 1010001