3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php for ($i=0; $i<=100; $i++){ if ($i % 15 == 0){ echo "FooBar"; }else if ($i % 3 == 0){ echo "Foo"; }else if ($i % 5 == 0){ echo "Bar"; }else{ echo $i; } if ($i != 100){ echo ", "; } }
Output for 4.3.0 - 7.2.0
FooBar, 1, 2, Foo, 4, Bar, Foo, 7, 8, Foo, Bar, 11, Foo, 13, 14, FooBar, 16, 17, Foo, 19, Bar, Foo, 22, 23, Foo, Bar, 26, Foo, 28, 29, FooBar, 31, 32, Foo, 34, Bar, Foo, 37, 38, Foo, Bar, 41, Foo, 43, 44, FooBar, 46, 47, Foo, 49, Bar, Foo, 52, 53, Foo, Bar, 56, Foo, 58, 59, FooBar, 61, 62, Foo, 64, Bar, Foo, 67, 68, Foo, Bar, 71, Foo, 73, 74, FooBar, 76, 77, Foo, 79, Bar, Foo, 82, 83, Foo, Bar, 86, Foo, 88, 89, FooBar, 91, 92, Foo, 94, Bar, Foo, 97, 98, Foo, Bar