3v4l.org

run code in 300+ PHP versions simultaneously
<?php function format(string $s) { print $s . ' is interprted as ' . date('r', strtotime($s)) . PHP_EOL; } format('5/6/22'); format('5.6.22'); format('5-6-22'); format('5/6/2022'); format('5.6.2022'); format('5-6-2022');
Output for 7.4.0 - 7.4.33, 8.0.1 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
5/6/22 is interprted as Fri, 06 May 2022 00:00:00 +0200 5.6.22 is interprted as Thu, 30 Jun 2022 05:06:22 +0200 5-6-22 is interprted as Wed, 22 Jun 2005 00:00:00 +0200 5/6/2022 is interprted as Fri, 06 May 2022 00:00:00 +0200 5.6.2022 is interprted as Sun, 05 Jun 2022 00:00:00 +0200 5-6-2022 is interprted as Sun, 05 Jun 2022 00:00:00 +0200

preferences:
124.82 ms | 403 KiB | 121 Q