3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $e=0; $calendar = array ('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'); while($e < sizeof($calendar)) { $k++; $days = 30; $days2 = 31; switch ($calendar[$e]) { case $calendar[0]: echo "Month ",$k,": $calendar[$e] has $days days <br>"; break; case $calendar[1]: echo "Month $k: $calendar[$e] has 28 or 29 days <br>"; break; case $calendar[2]: echo "Month $k: $calendar[$e] has $days2 days <br>"; break; case $calendar[3]: echo "Month $k: $calendar[$e] has $days days <br>"; break; case $calendar[4]: echo "Month $k: $calendar[$e] has $days days <br>"; break; case $calendar[5]: echo "Month $k: $calendar[$e] has $days days <br>"; break; case $calendar[6]: echo "Month $k: $calendar[$e] has $days2 days <br>"; break; case $calendar[7]: echo "Month $k: $calendar[$e] has $days days <br>"; break; case $calendar[8]: echo "Month $k: $calendar[$e] has $days days <br>"; break; case $calendar[9]: echo "Month $k: $calendar[$e] has $days2 days <br>"; break; case $calendar[10]: echo "Month $k: $calendar[$e] has $days days <br>"; break; case $calendar[11]: echo "Month $k: $calendar[$e] has $days2 days <br>"; break; } $e++; }
Output for 5.0.4 - 7.1.0
Notice: Undefined variable: k in /in/ULRXU on line 6 Month 1: January has 30 days <br>Month 2: February has 28 or 29 days <br>Month 3: March has 31 days <br>Month 4: April has 30 days <br>Month 5: May has 30 days <br>Month 6: June has 30 days <br>Month 7: July has 31 days <br>Month 8: August has 30 days <br>Month 9: September has 30 days <br>Month 10: October has 31 days <br>Month 11: November has 30 days <br>Month 12: December has 31 days <br>
Output for 4.3.0 - 5.0.3
Notice: Undefined variable: k in /in/ULRXU on line 6 Month 1: January has 30 days <br>Month 2: February has 28 or 29 days <br>Month 3: March has 31 days <br>Month 4: April has 30 days <br>Month 5: May has 30 days <br>Month 6: June has 30 days <br>Month 7: July has 31 days <br>Month 8: August has 30 days <br>Month 9: September has 30 days <br>Month 10: October has 31 days <br>Month 11: November has 30 days <br>Month 12: December has 31 days <br>