3v4l.org

run code in 300+ PHP versions simultaneously
<?php for ($i = 1; $i <= 31; $i++) { if ($i < 10){ $day = '0'.$i; if( ($i+1) < 10 ) $next_day = '0'.($i+1); else $next_day=$i+1; } else{ $day = $i; $next_day = ($i+1); } echo "$day $next_day".PHP_EOL; }
Output for 4.3.10 - 4.3.11, 4.4.0 - 4.4.9, 5.0.2 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
01 02 02 03 03 04 04 05 05 06 06 07 07 08 08 09 09 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32
Output for 4.3.0 - 4.3.9, 5.0.0 - 5.0.1
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/3GEWa on line 15 01 02PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/3GEWa on line 15 02 03PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/3GEWa on line 15 03 04PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/3GEWa on line 15 04 05PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/3GEWa on line 15 05 06PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/3GEWa on line 15 06 07PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/3GEWa on line 15 07 08PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/3GEWa on line 15 08 09PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/3GEWa on line 15 09 10PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/3GEWa on line 15 10 11PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/3GEWa on line 15 11 12PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/3GEWa on line 15 12 13PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/3GEWa on line 15 13 14PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/3GEWa on line 15 14 15PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/3GEWa on line 15 15 16PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/3GEWa on line 15 16 17PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/3GEWa on line 15 17 18PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/3GEWa on line 15 18 19PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/3GEWa on line 15 19 20PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/3GEWa on line 15 20 21PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/3GEWa on line 15 21 22PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/3GEWa on line 15 22 23PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/3GEWa on line 15 23 24PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/3GEWa on line 15 24 25PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/3GEWa on line 15 25 26PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/3GEWa on line 15 26 27PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/3GEWa on line 15 27 28PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/3GEWa on line 15 28 29PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/3GEWa on line 15 29 30PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/3GEWa on line 15 30 31PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/3GEWa on line 15 31 32PHP_EOL

preferences:
310.01 ms | 409 KiB | 455 Q