3v4l.org

run code in 300+ PHP versions simultaneously
<?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 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
Fatal error: Uncaught Error: Undefined constant "January" in /in/vM4PZ:3 Stack trace: #0 {main} thrown in /in/vM4PZ on line 3
Process exited with code 255.
Output for 7.2.0 - 7.2.33, 7.3.0 - 7.3.31, 7.4.0 - 7.4.25, 7.4.27 - 7.4.33
Warning: Use of undefined constant January - assumed 'January' (this will throw an Error in a future version of PHP) in /in/vM4PZ on line 3 Warning: Use of undefined constant February - assumed 'February' (this will throw an Error in a future version of PHP) in /in/vM4PZ on line 3 Warning: Use of undefined constant March - assumed 'March' (this will throw an Error in a future version of PHP) in /in/vM4PZ on line 3 Warning: Use of undefined constant April - assumed 'April' (this will throw an Error in a future version of PHP) in /in/vM4PZ on line 3 Warning: Use of undefined constant May - assumed 'May' (this will throw an Error in a future version of PHP) in /in/vM4PZ on line 3 Warning: Use of undefined constant June - assumed 'June' (this will throw an Error in a future version of PHP) in /in/vM4PZ on line 3 Warning: Use of undefined constant July - assumed 'July' (this will throw an Error in a future version of PHP) in /in/vM4PZ on line 3 Warning: Use of undefined constant August - assumed 'August' (this will throw an Error in a future version of PHP) in /in/vM4PZ on line 3 Warning: Use of undefined constant September - assumed 'September' (this will throw an Error in a future version of PHP) in /in/vM4PZ on line 3 Warning: Use of undefined constant October - assumed 'October' (this will throw an Error in a future version of PHP) in /in/vM4PZ on line 3 Warning: Use of undefined constant November - assumed 'November' (this will throw an Error in a future version of PHP) in /in/vM4PZ on line 3 Warning: Use of undefined constant December - assumed 'December' (this will throw an Error in a future version of PHP) 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 7.3.32 - 7.3.33, 7.4.26
Warning: Use of undefined constant January - assumed 'January' (this will throw an Error in a future version of PHP) in /in/vM4PZ on line 3 Warning: Use of undefined constant February - assumed 'February' (this will throw an Error in a future version of PHP) in /in/vM4PZ on line 3 Warning: Use of undefined constant March - assumed 'March' (this will throw an Error in a future version of PHP) in /in/vM4PZ on line 3 Warning: Use of undefined constant April - assumed 'April' (this will throw an Error in a future version of PHP) in /in/vM4PZ on line 3 Warning: Use of undefined constant May - assumed 'May' (this will throw an Error in a future version of PHP) in /in/vM4PZ on line 3 Warning: Use of undefined constant June - assumed 'June' (this will throw an Error in a future version of PHP) in /in/vM4PZ on line 3 Warning: Use of undefined constant July - assumed 'July' (this will throw an Error in a future version of PHP) in /in/vM4PZ on line 3 Warning: Use of undefined constant August - assumed 'August' (this will throw an Error in a future version of PHP) in /in/vM4PZ on line 3 Warning: Use of undefined constant September - assumed 'September' (this will throw an Error in a future version of PHP) in /in/vM4PZ on line 3 Warning: Use of undefined constant October - assumed 'October' (this will throw an Error in a future version of PHP) in /in/vM4PZ on line 3 Warning: Use of undefined constant November - assumed 'November' (this will throw an Error in a future version of PHP) in /in/vM4PZ on line 3 Warning: Use of undefined constant December - assumed 'December' (this will throw an Error in a future version of PHP) in /in/vM4PZ on line 3 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.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.33
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.0.5, 5.1.0 - 5.1.6, 5.2.0 - 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 - 4.3.11, 4.4.0 - 4.4.9, 5.0.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

preferences:
308.47 ms | 406 KiB | 400 Q