3v4l.org

run code in 300+ PHP versions simultaneously
<?php $range = range(1,10); $period = new DatePeriod( new DateTime('2019-07-17'), new DateInterval('P1D'), new DateTime('2019-07-20') ); foreach ($period as $key => $value) { foreach($range as $inc){ $seq = str_pad($inc,2,"0",STR_PAD_LEFT); $order_number = $value->format('Ymd').'-'.$seq; echo $order_number.PHP_EOL; } echo PHP_EOL."===========".PHP_EOL; }
Output for 7.1.25 - 7.1.30, 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.28, 8.2.0 - 8.2.19, 8.3.0 - 8.3.7
20190717-01 20190717-02 20190717-03 20190717-04 20190717-05 20190717-06 20190717-07 20190717-08 20190717-09 20190717-10 =========== 20190718-01 20190718-02 20190718-03 20190718-04 20190718-05 20190718-06 20190718-07 20190718-08 20190718-09 20190718-10 =========== 20190719-01 20190719-02 20190719-03 20190719-04 20190719-05 20190719-06 20190719-07 20190719-08 20190719-09 20190719-10 ===========

preferences:
116.07 ms | 404 KiB | 172 Q