3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?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; }
based on nDscY
Output for 4.3.10 - 4.4.9, 5.0.2 - 5.6.21, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
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