3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $testArray = array("1985-03-17", "today", "17/03", "17-03", "17 03 1985", "17/03/1985", "mar 85", "03/1985", "03-1985", "march"); $unixArray = array(); for($i = 0, $size = count($testArray); $i < $size; ++$i) { $testDate = $testArray[$i]; $unixArray[$i] = strtotime($testDate); } echo "ci sono ", count($unixArray); echo " valori \n" ; for($i = 0, $size = count($unixArray); $i < $size; ++$i) { $unixDate = $unixArray[$i]; echo $unixDate, " - "; // echo date('l H\:iO',$unixDate), " - "; echo date('r',$unixDate), " - "; echo $testArray[$i], " - "; echo "\n"; }
Output for 5.2.7 - 7.1.0
ci sono 10 valori 479862000 - Sun, 17 Mar 1985 00:00:00 +0100 - 1985-03-17 - 1387580400 - Sat, 21 Dec 2013 00:00:00 +0100 - today - - Thu, 01 Jan 1970 01:00:00 +0100 - 17/03 - - Thu, 01 Jan 1970 01:00:00 +0100 - 17-03 - - Thu, 01 Jan 1970 01:00:00 +0100 - 17 03 1985 - - Thu, 01 Jan 1970 01:00:00 +0100 - 17/03/1985 - - Thu, 01 Jan 1970 01:00:00 +0100 - mar 85 - - Thu, 01 Jan 1970 01:00:00 +0100 - 03/1985 - - Thu, 01 Jan 1970 01:00:00 +0100 - 03-1985 - 1363820400 - Thu, 21 Mar 2013 00:00:00 +0100 - march -
Output for 5.2.0 - 5.2.6
ci sono 10 valori 479862000 - Sun, 17 Mar 1985 00:00:00 +0100 - 1985-03-17 - 1387580400 - Sat, 21 Dec 2013 00:00:00 +0100 - today - - Thu, 01 Jan 1970 01:00:00 +0100 - 17/03 - - Thu, 01 Jan 1970 01:00:00 +0100 - 17-03 - - Thu, 01 Jan 1970 01:00:00 +0100 - 17 03 1985 - - Thu, 01 Jan 1970 01:00:00 +0100 - 17/03/1985 - 1369346400 - Fri, 24 May 2013 00:00:00 +0200 - mar 85 - - Thu, 01 Jan 1970 01:00:00 +0100 - 03/1985 - - Thu, 01 Jan 1970 01:00:00 +0100 - 03-1985 - 1363820400 - Thu, 21 Mar 2013 00:00:00 +0100 - march -
Output for 5.1.0 - 5.1.6
ci sono 10 valori 479862000 - Sun, 17 Mar 1985 00:00:00 +0100 - 1985-03-17 - 1387580400 - Sat, 21 Dec 2013 00:00:00 +0100 - today - - Thu, 01 Jan 1970 01:00:00 +0100 - 17/03 - - Thu, 01 Jan 1970 01:00:00 +0100 - 17-03 - - Thu, 01 Jan 1970 01:00:00 +0100 - 17 03 1985 - - Thu, 01 Jan 1970 01:00:00 +0100 - 17/03/1985 - 1369346400 - Fri, 24 May 2013 00:00:00 +0200 - mar 85 - - Thu, 01 Jan 1970 01:00:00 +0100 - 03/1985 - - Thu, 01 Jan 1970 01:00:00 +0100 - 03-1985 - - Thu, 01 Jan 1970 01:00:00 +0100 - march -
Output for 5.0.4 - 5.0.5
ci sono 10 valori 479862000 - Sun, 17 Mar 1985 00:00:00 +0100 - 1985-03-17 - 1387644809 - Sat, 21 Dec 2013 17:53:29 +0100 - today - 1399068000 - Sat, 03 May 2014 00:00:00 +0200 - 17/03 - 1488322800 - Wed, 01 Mar 2017 00:00:00 +0100 - 17-03 - -1 - Thu, 01 Jan 1970 00:59:59 +0100 - 17 03 1985 - 515455200 - Sat, 03 May 1986 00:00:00 +0200 - 17/03/1985 - 1369346400 - Fri, 24 May 2013 00:00:00 +0200 - mar 85 - 1533506400 - Mon, 06 Aug 2018 00:00:00 +0200 - 03/1985 - 6258722400 - Sun, 01 May 2168 00:00:00 +0200 - 03-1985 - -1 - Thu, 01 Jan 1970 00:59:59 +0100 - march -
Output for 5.0.3
ci sono 10 valori 479862000 - Sun, 17 Mar 1985 00:00:00 +0100 - 1985-03-17 - 1387644809 - Sat, 21 Dec 2013 17:53:29 +0100 - today - 1399068000 - Sat, 3 May 2014 00:00:00 +0200 - 17/03 - 1488322800 - Wed, 1 Mar 2017 00:00:00 +0100 - 17-03 - -1 - Thu, 1 Jan 1970 00:59:59 +0100 - 17 03 1985 - 515455200 - Sat, 3 May 1986 00:00:00 +0200 - 17/03/1985 - 1369346400 - Fri, 24 May 2013 00:00:00 +0200 - mar 85 - 1533506400 - Mon, 6 Aug 2018 00:00:00 +0200 - 03/1985 - 6258722400 - Sun, 1 May 2168 00:00:00 +0200 - 03-1985 - -1 - Thu, 1 Jan 1970 00:59:59 +0100 - march -
Output for 5.0.0 - 5.0.2
ci sono 10 valori 479862000 - Sun, 17 Mar 1985 00:00:00 +0100 - 1985-03-17 - 1387580400 - Sat, 21 Dec 2013 00:00:00 +0100 - today - 1399068000 - Sat, 3 May 2014 00:00:00 +0200 - 17/03 - 1488322800 - Wed, 1 Mar 2017 00:00:00 +0100 - 17-03 - -1 - Thu, 1 Jan 1970 00:59:59 +0100 - 17 03 1985 - 515455200 - Sat, 3 May 1986 00:00:00 +0200 - 17/03/1985 - 1369346400 - Fri, 24 May 2013 00:00:00 +0200 - mar 85 - 1533506400 - Mon, 6 Aug 2018 00:00:00 +0200 - 03/1985 - 6258722400 - Sun, 1 May 2168 00:00:00 +0200 - 03-1985 - -1 - Thu, 1 Jan 1970 00:59:59 +0100 - march -
Output for 4.3.11 - 4.4.9
ci sono 10 valori 479862000 - Sun, 17 Mar 1985 00:00:00 +0100 - 1985-03-17 - 1387644809 - Sat, 21 Dec 2013 17:53:29 +0100 - today - 1399068000 - Sat, 03 May 2014 00:00:00 +0200 - 17/03 - -1 - Thu, 01 Jan 1970 00:59:59 +0100 - 17-03 - -1 - Thu, 01 Jan 1970 00:59:59 +0100 - 17 03 1985 - 515455200 - Sat, 03 May 1986 00:00:00 +0200 - 17/03/1985 - 1369346400 - Fri, 24 May 2013 00:00:00 +0200 - mar 85 - 1533506400 - Mon, 06 Aug 2018 00:00:00 +0200 - 03/1985 - -1 - Thu, 01 Jan 1970 00:59:59 +0100 - 03-1985 - -1 - Thu, 01 Jan 1970 00:59:59 +0100 - march -
Output for 4.3.0 - 4.3.10
ci sono 10 valori 479862000 - Sun, 17 Mar 1985 00:00:00 +0100 - 1985-03-17 - 1387644809 - Sat, 21 Dec 2013 17:53:29 +0100 - today - 1399068000 - Sat, 3 May 2014 00:00:00 +0200 - 17/03 - -1 - Thu, 1 Jan 1970 00:59:59 +0100 - 17-03 - -1 - Thu, 1 Jan 1970 00:59:59 +0100 - 17 03 1985 - 515455200 - Sat, 3 May 1986 00:00:00 +0200 - 17/03/1985 - 1369346400 - Fri, 24 May 2013 00:00:00 +0200 - mar 85 - 1533506400 - Mon, 6 Aug 2018 00:00:00 +0200 - 03/1985 - -1 - Thu, 1 Jan 1970 00:59:59 +0100 - 03-1985 - -1 - Thu, 1 Jan 1970 00:59:59 +0100 - march -