3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php define("STOP_AT", 1024); $result = array(); for($idx = 1; $idx < STOP_AT; $idx *= 2) { $result[] = $idx; } print_r($result);
based on NoB0m
Output for 4.3.0 - 7.1.0
Array ( [0] => 1 [1] => 2 [2] => 4 [3] => 8 [4] => 16 [5] => 32 [6] => 64 [7] => 128 [8] => 256 [9] => 512 )