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 (explode(', ', '1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225') as $num) { settype($num, 'integer'); echo decbin($num)."\n"; }
Output for 4.3.0 - 7.1.0
1, 4, 9, 16, 25, 36, 49, 64, 81 1 100 1001 10000 11001 100100 110001 1000000 1010001 1100100 1111001 10010000 10101001 11000100 11100001