3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $int = 3; $exponent = 0; $count = 1; for ($i = 2; $i <= $int; $i++) { echo $i . PHP_EOL; echo pow(2, $exponent) . PHP_EOL; if ($i > pow(2, $exponent) + 1) { echo 'here' . PHP_EOL; $count++; $exponent++; } } echo $count;
based on kPIld
Output for 5.6.30, hhvm-3.18.5 - 3.22.0, 7.0.30 - 7.3.0alpha1
2 1 3 1 here 2