3v4l.org

run code in 300+ PHP versions simultaneously
<?PHP function mysql_date($in) { //Function takes a string in as form data, splits it by a list of //possible separators. If the resulting array has a length of 3, the //function returns a MySQL compatible date() string, else returns false // //Also, uses the checkdate() [PHP core function] to validate the date. $output = false; $d = preg_split('#[-/:. ]#', trim($in)); if (is_array($d) && count($d) == 3) { if (strlen($d[2]) == 2) { $d[2] = '20'.$d[2]; } if (checkdate($d[0], $d[1], $d[2])) { $output = "$d[2]-$d[0]-$d[1]"; } } return $output; } echo mysql_date('05/07/2014');

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
8.3.60.0070.00718.43
8.3.50.0100.01022.05
8.3.40.0110.00719.04
8.3.30.0140.00019.09
8.3.20.0060.00320.35
8.3.10.0080.00021.96
8.3.00.0000.00822.52
8.2.180.0130.01316.75
8.2.170.0040.01122.96
8.2.160.0070.00721.20
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0090.00626.16
8.2.120.0000.00819.48
8.2.110.0030.00721.04
8.2.100.0080.00418.03
8.2.90.0040.00419.40
8.2.80.0030.00618.04
8.2.70.0050.00317.75
8.2.60.0040.00418.05
8.2.50.0040.00418.07
8.2.40.0030.00618.22
8.2.30.0070.00018.26
8.2.20.0050.00317.92
8.2.10.0050.00318.07
8.2.00.0030.00517.90
8.1.280.0100.00725.92
8.1.270.0060.00322.04
8.1.260.0000.00826.35
8.1.250.0030.00528.09
8.1.240.0060.00320.95
8.1.230.0110.00020.97
8.1.220.0000.00817.79
8.1.210.0060.00318.77
8.1.200.0060.00317.60
8.1.190.0060.00617.41
8.1.180.0050.00318.10
8.1.170.0030.00618.78
8.1.160.0040.00422.06
8.1.150.0080.00018.88
8.1.140.0000.00717.73
8.1.130.0000.00917.87
8.1.120.0000.00717.66
8.1.110.0040.00417.66
8.1.100.0040.00417.52
8.1.90.0050.00317.71
8.1.80.0040.00417.69
8.1.70.0030.00317.64
8.1.60.0040.00417.80
8.1.50.0040.00417.68
8.1.40.0050.00217.68
8.1.30.0080.00017.77
8.1.20.0040.00417.72
8.1.10.0050.00317.66
8.1.00.0040.00417.63
8.0.300.0040.00418.77
8.0.290.0040.00417.30
8.0.280.0030.00318.56
8.0.270.0030.00317.34
8.0.260.0030.00317.11
8.0.250.0030.00517.20
8.0.240.0060.00317.13
8.0.230.0050.00217.07
8.0.220.0000.00717.15
8.0.210.0000.00717.04
8.0.200.0000.00717.08
8.0.190.0030.00417.20
8.0.180.0040.00417.15
8.0.170.0040.00417.16
8.0.160.0070.00017.06
8.0.150.0070.00016.96
8.0.140.0030.00317.11
8.0.130.0000.00613.51
8.0.120.0050.00317.12
8.0.110.0000.00817.06
8.0.100.0030.00616.97
8.0.90.0000.00717.15
8.0.80.0100.01017.04
8.0.70.0000.00717.20
8.0.60.0040.00417.02
8.0.50.0000.00716.91
8.0.30.0080.01017.20
8.0.20.0040.01517.40
8.0.10.0000.00817.21
8.0.00.0120.00617.08
7.4.330.0060.00015.02
7.4.320.0030.00316.78
7.4.300.0030.00316.69
7.4.290.0070.00016.75
7.4.280.0070.00016.72
7.4.270.0030.00616.77
7.4.260.0000.00716.75
7.4.250.0080.00016.79
7.4.240.0050.00216.84
7.4.230.0000.00816.74
7.4.220.0200.00716.94
7.4.210.0050.01016.75
7.4.200.0030.00316.91
7.4.190.0040.00416.99
7.4.160.0160.00016.83
7.4.150.0070.01017.40
7.4.140.0080.01017.86
7.4.130.0080.01016.73
7.4.120.0100.00716.88
7.4.110.0190.00016.80
7.4.100.0190.00316.79
7.4.90.0040.01616.70
7.4.80.0030.02119.39
7.4.70.0120.00916.83
7.4.60.0120.00616.64
7.4.50.0030.00516.84
7.4.40.0100.00622.77
7.4.30.0060.00916.53
7.4.00.0080.00914.94
7.3.330.0050.00013.49
7.3.320.0060.00013.50
7.3.310.0050.00316.43
7.3.300.0070.00016.39
7.3.290.0040.01616.47
7.3.280.0110.00916.47
7.3.270.0100.00717.40
7.3.260.0120.00916.70
7.3.250.0130.00516.56
7.3.240.0140.00716.54
7.3.230.0060.01116.70
7.3.210.0120.00616.68
7.3.200.0090.00919.39
7.3.190.0110.00716.54
7.3.180.0130.00316.69
7.3.170.0100.00716.67
7.3.160.0150.00016.68
7.3.120.0050.01315.02
7.3.110.0080.00814.98
7.3.100.0070.00414.79
7.3.90.0070.01015.06
7.3.80.0030.01014.92
7.3.70.0000.00915.00
7.3.60.0030.00615.06
7.3.50.0000.00915.10
7.3.40.0000.01415.08
7.3.30.0060.00615.12
7.3.20.0100.00316.60
7.3.10.0050.00516.85
7.3.00.0070.00516.72
7.2.330.0120.00616.84
7.2.320.0090.00916.89
7.2.310.0070.01117.05
7.2.300.0060.01316.87
7.2.290.0110.01116.64
7.2.250.0160.00315.06
7.2.240.0100.01015.42
7.2.230.0060.00915.06
7.2.220.0100.00615.46
7.2.210.0070.00715.34
7.2.200.0110.00415.38
7.2.190.0080.00615.32
7.2.180.0100.00715.37
7.2.170.0000.01415.36
7.2.130.0000.01317.14
7.2.120.0110.00017.21
7.2.110.0060.00617.11
7.2.100.0030.01017.02
7.2.90.0000.01117.20
7.2.80.0060.00617.04
7.2.70.0040.00717.12
7.2.60.0000.00917.09
7.2.50.0000.00817.19
7.2.40.0060.00316.95
7.2.30.0030.00917.18
7.2.20.0000.01317.13
7.2.10.0030.00616.98
7.2.00.0040.01118.26
7.1.330.0070.00716.01
7.1.320.0000.01415.98
7.1.310.0070.00716.13
7.1.300.0120.00016.09
7.1.290.0070.00716.27
7.1.280.0070.00416.10
7.1.270.0030.00915.98
7.1.260.0040.00816.21
7.1.250.0060.00616.04
7.1.100.0000.01318.31
7.1.70.0000.00817.46
7.1.60.0070.01419.82
7.1.50.0060.00617.29
7.1.00.0100.08322.45
7.0.200.0120.00216.98
7.0.140.0030.07721.95
7.0.60.0130.06719.84
7.0.50.0100.05317.88
7.0.40.0130.06020.42
7.0.30.0470.05320.32
7.0.20.0270.05020.16
7.0.10.0070.08720.31
7.0.00.0130.05720.11
5.6.280.0130.06020.82
5.6.210.0170.07020.73
5.6.200.0070.08018.18
5.6.190.0100.06720.65
5.6.180.0170.08320.34
5.6.170.0300.03320.71
5.6.160.0200.06320.44
5.6.150.0070.04018.14
5.6.140.0070.04018.28
5.6.130.0000.05318.20
5.6.120.0130.07721.15
5.6.110.0100.08721.08
5.6.100.0030.08021.02
5.6.90.0200.07320.97
5.6.80.0000.07720.40
5.6.70.4400.04020.41
5.5.350.0000.03320.53
5.5.340.0000.04718.02
5.5.330.0070.05720.30
5.5.320.0270.07720.51
5.5.310.0100.05320.36
5.5.300.0030.07718.03
5.5.290.0030.08018.02
5.5.280.0030.04720.88
5.5.270.0030.06020.80
5.5.260.0070.07320.77
5.5.250.0070.09020.70
5.5.240.0270.05020.14
5.4.450.0530.04019.44
5.4.440.0100.04319.42
5.4.430.0200.04319.53
5.4.420.0170.05019.39
5.4.410.0200.05319.08
5.4.400.0470.04018.50
5.4.390.0300.05318.79
5.4.380.0330.05718.73
5.4.370.0070.04318.47
5.4.360.0070.03718.67
5.4.350.0080.03212.02
5.4.340.0060.04112.02
5.4.320.0060.04912.50
5.4.310.0090.03912.50
5.4.300.0040.03912.50
5.4.290.0070.04712.50
5.4.280.0090.03412.37
5.4.270.0090.03812.38
5.4.260.0110.04012.37
5.4.250.0100.05312.38
5.4.240.0130.04812.38
5.4.230.0080.05512.36
5.4.220.0090.04812.36
5.4.210.0110.03512.36
5.4.200.0120.04412.36
5.4.190.0090.03412.36
5.4.180.0080.03612.36
5.4.170.0090.03812.37
5.4.160.0080.03812.37
5.4.150.0100.03512.36
5.4.140.0130.04212.04
5.4.130.0090.05312.03
5.4.120.0090.04611.99
5.4.110.0060.04511.98
5.4.100.0090.04911.98
5.4.90.0080.04211.98
5.4.80.0060.03911.98
5.4.70.0080.03611.98
5.4.60.0070.04311.98
5.4.50.0080.04411.98
5.4.40.0120.03711.97
5.4.30.0080.03411.96
5.4.20.0060.04211.96
5.4.10.0110.04811.96
5.4.00.0050.03611.46
5.3.290.0060.04012.80
5.3.280.0100.03812.71
5.3.270.0090.04512.72
5.3.260.0080.04512.71
5.3.250.0100.03312.72
5.3.240.0080.03912.71
5.3.230.0080.03712.71
5.3.220.0120.04312.68
5.3.210.0080.03812.68
5.3.200.0060.04112.68
5.3.190.0090.05012.68
5.3.180.0050.04212.67
5.3.170.0110.03312.66
5.3.160.0070.03712.67
5.3.150.0080.03712.67
5.3.140.0060.04012.66
5.3.130.0050.04212.66
5.3.120.0090.04112.66
5.3.110.0060.04712.66
5.3.100.0080.04112.12
5.3.90.0060.03912.09
5.3.80.0080.03712.07
5.3.70.0080.04712.08
5.3.60.0090.03512.07
5.3.50.0100.03512.00
5.3.40.0080.03512.00
5.3.30.0080.03911.97
5.3.20.0040.03811.73
5.3.10.0080.03511.70
5.3.00.0080.03711.69
5.2.170.0040.0459.18
5.2.160.0090.0289.18
5.2.150.0090.0369.18
5.2.140.0060.0309.18
5.2.130.0070.0289.14
5.2.120.0020.0349.14
5.2.110.0060.0329.15
5.2.100.0060.0279.15
5.2.90.0070.0329.14
5.2.80.0030.0369.14
5.2.70.0040.0329.14
5.2.60.0050.0319.10
5.2.50.0050.0319.07
5.2.40.0060.0289.04
5.2.30.0030.0329.02
5.2.20.0070.0349.01
5.2.10.0030.0338.92
5.2.00.0090.0418.78
5.1.60.0050.0308.07
5.1.50.0120.0328.06
5.1.40.0080.0338.04
5.1.30.0060.0258.39
5.1.20.0040.0278.42
5.1.10.0080.0308.14
5.1.00.0050.0288.14
5.0.50.0060.0226.63
5.0.40.0040.0196.50
5.0.30.0040.0316.31
5.0.20.0040.0196.27
5.0.10.0050.0186.26
5.0.00.0040.0336.25
4.4.90.0020.0164.78
4.4.80.0070.0124.75
4.4.70.0060.0134.76
4.4.60.0050.0144.75
4.4.50.0040.0224.77
4.4.40.0050.0314.71
4.4.30.0070.0154.75
4.4.20.0050.0214.84
4.4.10.0030.0164.84
4.4.00.0050.0244.76
4.3.110.0070.0134.67
4.3.100.0030.0164.66
4.3.90.0030.0154.63
4.3.80.0030.0254.59
4.3.70.0020.0154.63
4.3.60.0030.0154.63
4.3.50.0020.0174.63
4.3.40.0050.0224.53
4.3.30.0010.0173.30
4.3.20.0030.0153.28
4.3.10.0020.0173.25
4.3.00.0030.01313.33

preferences:
36.44 ms | 401 KiB | 5 Q