3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function quarter($month) { echo $i, " => ", ceil($month / 3), "\n"; } foreach (range(1, 13) as $i) { quarter($i); }
Output for 5.0.4 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Notice: Undefined variable: i in /in/t5MPq on line 4 => 1 Notice: Undefined variable: i in /in/t5MPq on line 4 => 1 Notice: Undefined variable: i in /in/t5MPq on line 4 => 1 Notice: Undefined variable: i in /in/t5MPq on line 4 => 2 Notice: Undefined variable: i in /in/t5MPq on line 4 => 2 Notice: Undefined variable: i in /in/t5MPq on line 4 => 2 Notice: Undefined variable: i in /in/t5MPq on line 4 => 3 Notice: Undefined variable: i in /in/t5MPq on line 4 => 3 Notice: Undefined variable: i in /in/t5MPq on line 4 => 3 Notice: Undefined variable: i in /in/t5MPq on line 4 => 4 Notice: Undefined variable: i in /in/t5MPq on line 4 => 4 Notice: Undefined variable: i in /in/t5MPq on line 4 => 4 Notice: Undefined variable: i in /in/t5MPq on line 4 => 5
Output for 4.3.0 - 5.0.3
Notice: Undefined variable: i in /in/t5MPq on line 4 => 1 Notice: Undefined variable: i in /in/t5MPq on line 4 => 1 Notice: Undefined variable: i in /in/t5MPq on line 4 => 1 Notice: Undefined variable: i in /in/t5MPq on line 4 => 2 Notice: Undefined variable: i in /in/t5MPq on line 4 => 2 Notice: Undefined variable: i in /in/t5MPq on line 4 => 2 Notice: Undefined variable: i in /in/t5MPq on line 4 => 3 Notice: Undefined variable: i in /in/t5MPq on line 4 => 3 Notice: Undefined variable: i in /in/t5MPq on line 4 => 3 Notice: Undefined variable: i in /in/t5MPq on line 4 => 4 Notice: Undefined variable: i in /in/t5MPq on line 4 => 4 Notice: Undefined variable: i in /in/t5MPq on line 4 => 4 Notice: Undefined variable: i in /in/t5MPq on line 4 => 5