3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php if ($i == 0) { echo "i equals 0"; } elseif ($i == 1) { echo "i equals 1"; } elseif ($i == 2) { echo "i equals 2"; } switch ($i) { case 0: echo "i equals 0"; break; case 1: echo "i equals 1"; break; case 2: echo "i equals 2"; break; } ?>
Output for 5.1.0 - 5.6.28, 7.0.0 - 7.1.0
Notice: Undefined variable: i in /in/p6iNg on line 2 i equals 0 Notice: Undefined variable: i in /in/p6iNg on line 11 i equals 0
Output for hhvm-3.10.0 - 3.12.0
Notice: Undefined variable: i in /in/p6iNg on line 2 i equals 0 Notice: Undefined variable: i in /in/p6iNg on line 20 i equals 0
Output for 5.0.4 - 5.0.5
Notice: Undefined variable: i in /in/p6iNg on line 2 i equals 0 Notice: Undefined variable: i in /in/p6iNg on line 10 i equals 0
Output for 4.3.0 - 5.0.3
Notice: Undefined variable: i in /in/p6iNg on line 2 i equals 0 Notice: Undefined variable: i in /in/p6iNg on line 10 i equals 0