3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $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++; echo $e; }
Output for 5.3.0 - 7.1.0
Notice: Use of undefined constant January - assumed 'January' in /in/vM4PZ on line 3 Notice: Use of undefined constant February - assumed 'February' in /in/vM4PZ on line 3 Notice: Use of undefined constant March - assumed 'March' in /in/vM4PZ on line 3 Notice: Use of undefined constant April - assumed 'April' in /in/vM4PZ on line 3 Notice: Use of undefined constant May - assumed 'May' in /in/vM4PZ on line 3 Notice: Use of undefined constant June - assumed 'June' in /in/vM4PZ on line 3 Notice: Use of undefined constant July - assumed 'July' in /in/vM4PZ on line 3 Notice: Use of undefined constant August - assumed 'August' in /in/vM4PZ on line 3 Notice: Use of undefined constant September - assumed 'September' in /in/vM4PZ on line 3 Notice: Use of undefined constant October - assumed 'October' in /in/vM4PZ on line 3 Notice: Use of undefined constant November - assumed 'November' in /in/vM4PZ on line 3 Notice: Use of undefined constant December - assumed 'December' in /in/vM4PZ on line 3 Notice: Undefined variable: e in /in/vM4PZ on line 4 Notice: Undefined variable: k in /in/vM4PZ on line 6 Notice: Undefined variable: e in /in/vM4PZ on line 9 Notice: Undefined index: in /in/vM4PZ on line 9 Notice: Undefined variable: e in /in/vM4PZ on line 49 1Month 2: February has 28 or 29 days <br>2Month 3: March has 31 days <br>3Month 4: April has 30 days <br>4Month 5: May has 30 days <br>5Month 6: June has 30 days <br>6Month 7: July has 31 days <br>7Month 8: August has 30 days <br>8Month 9: September has 30 days <br>9Month 10: October has 31 days <br>10Month 11: November has 30 days <br>11Month 12: December has 31 days <br>12
Output for 5.0.4 - 5.2.17
Notice: Use of undefined constant January - assumed 'January' in /in/vM4PZ on line 3 Notice: Use of undefined constant February - assumed 'February' in /in/vM4PZ on line 3 Notice: Use of undefined constant March - assumed 'March' in /in/vM4PZ on line 3 Notice: Use of undefined constant April - assumed 'April' in /in/vM4PZ on line 3 Notice: Use of undefined constant May - assumed 'May' in /in/vM4PZ on line 3 Notice: Use of undefined constant June - assumed 'June' in /in/vM4PZ on line 3 Notice: Use of undefined constant July - assumed 'July' in /in/vM4PZ on line 3 Notice: Use of undefined constant August - assumed 'August' in /in/vM4PZ on line 3 Notice: Use of undefined constant September - assumed 'September' in /in/vM4PZ on line 3 Notice: Use of undefined constant October - assumed 'October' in /in/vM4PZ on line 3 Notice: Use of undefined constant November - assumed 'November' in /in/vM4PZ on line 3 Notice: Use of undefined constant December - assumed 'December' in /in/vM4PZ on line 3 Notice: Undefined variable: e in /in/vM4PZ on line 4 Notice: Undefined variable: k in /in/vM4PZ on line 6 Notice: Undefined variable: e in /in/vM4PZ on line 9 Notice: Undefined index: in /in/vM4PZ on line 9 Notice: Undefined variable: e in /in/vM4PZ on line 49 1Month 2: February has 28 or 29 days <br>2Month 3: March has 31 days <br>3Month 4: April has 30 days <br>4Month 5: May has 30 days <br>5Month 6: June has 30 days <br>6Month 7: July has 31 days <br>7Month 8: August has 30 days <br>8Month 9: September has 30 days <br>9Month 10: October has 31 days <br>10Month 11: November has 30 days <br>11Month 12: December has 31 days <br>12
Output for 4.3.0 - 5.0.3
Notice: Use of undefined constant January - assumed 'January' in /in/vM4PZ on line 3 Notice: Use of undefined constant February - assumed 'February' in /in/vM4PZ on line 3 Notice: Use of undefined constant March - assumed 'March' in /in/vM4PZ on line 3 Notice: Use of undefined constant April - assumed 'April' in /in/vM4PZ on line 3 Notice: Use of undefined constant May - assumed 'May' in /in/vM4PZ on line 3 Notice: Use of undefined constant June - assumed 'June' in /in/vM4PZ on line 3 Notice: Use of undefined constant July - assumed 'July' in /in/vM4PZ on line 3 Notice: Use of undefined constant August - assumed 'August' in /in/vM4PZ on line 3 Notice: Use of undefined constant September - assumed 'September' in /in/vM4PZ on line 3 Notice: Use of undefined constant October - assumed 'October' in /in/vM4PZ on line 3 Notice: Use of undefined constant November - assumed 'November' in /in/vM4PZ on line 3 Notice: Use of undefined constant December - assumed 'December' in /in/vM4PZ on line 3 Notice: Undefined variable: e in /in/vM4PZ on line 4 Notice: Undefined variable: k in /in/vM4PZ on line 6 Notice: Undefined variable: e in /in/vM4PZ on line 9 Notice: Undefined index: in /in/vM4PZ on line 9 Notice: Undefined variable: e in /in/vM4PZ on line 49 1Month 2: February has 28 or 29 days <br>2Month 3: March has 31 days <br>3Month 4: April has 30 days <br>4Month 5: May has 30 days <br>5Month 6: June has 30 days <br>6Month 7: July has 31 days <br>7Month 8: August has 30 days <br>8Month 9: September has 30 days <br>9Month 10: October has 31 days <br>10Month 11: November has 30 days <br>11Month 12: December has 31 days <br>12