3v4l.org

run code in 300+ PHP versions simultaneously
<?php function convertToTimestamp($str) { $str = trim($str); if (!function_exists('date_create')) { $ts = strtotime($str); // Doku: Vor PHP 5.1.0 gab die Funktion -1 im Fehlerfall zurück. #if ($ts === -1) $ts = false; return $ts; } $oDate = date_create($str); if (is_object($oDate)) { return (int)$oDate->format('U'); } return false; } var_dump( convertToTimestamp("2012-01-01") ); // 1325376000 echo "\n"; var_dump( convertToTimestamp("foo") ); // sollte false oder -1

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.40.0090.01218.96
8.3.30.0040.01118.84
8.3.20.0050.00318.91
8.3.10.0080.00020.66
8.3.00.0040.00419.38
8.2.170.0100.01022.96
8.2.160.0090.00621.19
8.2.150.0050.00324.18
8.2.140.0080.00024.66
8.2.130.0080.00026.16
8.2.120.0050.00319.61
8.2.110.0030.00621.10
8.2.100.0040.00717.97
8.2.90.0030.00619.30
8.2.80.0040.00417.97
8.2.70.0030.00617.75
8.2.60.0020.00718.05
8.2.50.0050.00318.07
8.2.40.0050.00218.28
8.2.30.0030.00618.14
8.2.20.0000.00717.77
8.2.10.0040.00417.96
8.2.00.0040.00417.91
8.1.270.0080.00024.66
8.1.260.0070.00326.35
8.1.250.0070.00028.09
8.1.240.0140.00721.55
8.1.230.0050.00517.52
8.1.220.0040.00417.79
8.1.210.0050.00318.77
8.1.200.0060.00317.60
8.1.190.0090.00017.60
8.1.180.0040.00418.10
8.1.170.0000.00818.73
8.1.160.0040.00419.00
8.1.150.0040.00418.88
8.1.140.0040.00417.60
8.1.130.0060.00317.91
8.1.120.0000.00717.72
8.1.110.0000.00717.71
8.1.100.0070.00017.59
8.1.90.0040.00417.72
8.1.80.0030.00517.66
8.1.70.0050.00217.57
8.1.60.0040.00417.66
8.1.50.0000.00817.54
8.1.40.0000.00917.74
8.1.30.0030.00617.74
8.1.20.0040.00417.76
8.1.10.0000.00717.58
8.1.00.0050.00217.71
8.0.300.0070.00018.77
8.0.290.0000.00716.88
8.0.280.0030.00318.57
8.0.270.0030.00317.38
8.0.260.0040.00417.07
8.0.250.0000.00817.09
8.0.240.0030.00617.20
8.0.230.0030.00317.24
8.0.220.0000.00717.05
8.0.210.0030.00317.05
8.0.200.0000.00617.11
8.0.190.0050.00217.07
8.0.180.0000.00817.23
8.0.170.0050.00317.15
8.0.160.0040.00417.04
8.0.150.0030.00617.04
8.0.140.0000.01117.19
8.0.130.0000.00513.54
8.0.120.0030.00517.11
8.0.110.0040.00417.02
8.0.100.0070.00017.09
8.0.90.0050.00217.04
8.0.80.0070.00717.13
8.0.70.0040.00417.15
8.0.60.0030.00517.16
8.0.50.0080.00017.20
8.0.30.0070.01417.22
8.0.20.0100.00817.41
8.0.10.0000.00717.13
8.0.00.0130.00917.06
7.4.330.0030.00313.29
7.4.320.0040.00416.61
7.4.300.0030.00616.77
7.4.290.0030.00316.68
7.4.280.0040.00416.68
7.4.270.0030.00316.80
7.4.260.0000.00513.41
7.4.250.0040.00416.66
7.4.240.0030.00316.67
7.4.230.0000.00716.82
7.4.220.0150.00316.71
7.4.210.0070.00816.78
7.4.200.0030.00316.68
7.4.190.0040.00416.66
7.4.160.0100.00716.68
7.4.150.0090.00916.82
7.4.140.0100.01316.71
7.4.130.0080.00916.83
7.4.120.0080.00916.60
7.4.110.0030.01316.76
7.4.100.0060.01616.77
7.4.90.0190.00616.77
7.4.80.0130.00316.71
7.4.70.0100.01316.81
7.4.60.0060.01816.88
7.4.50.0030.00316.64
7.4.40.0090.00616.93
7.4.30.0100.00616.70
7.4.00.0070.00715.23
7.3.330.0000.00613.38
7.3.320.0030.00313.49
7.3.310.0030.00316.45
7.3.300.0000.00716.44
7.3.290.0100.00916.43
7.3.280.0080.00716.47
7.3.270.0060.01516.57
7.3.260.0110.01216.63
7.3.250.0090.00916.62
7.3.240.0100.00716.55
7.3.230.0040.01416.54
7.3.210.0100.00616.63
7.3.200.0060.01619.39
7.3.190.0120.01216.77
7.3.180.0060.00916.71
7.3.170.0090.00616.43
7.3.160.0030.01316.57
7.3.120.0090.00314.84
7.3.110.0070.00715.27
7.3.100.0070.00714.96
7.3.90.0110.00314.97
7.3.80.0030.00615.04
7.3.70.0110.00314.98
7.3.60.0070.00714.89
7.3.50.0070.00715.14
7.3.40.0030.00615.14
7.3.30.0030.01015.00
7.3.20.0090.00616.51
7.3.10.0120.00316.89
7.3.00.0090.00617.04
7.2.330.0110.00716.93
7.2.320.0100.00716.69
7.2.310.0040.01916.88
7.2.300.0060.01216.90
7.2.290.0060.01216.75
7.2.240.0110.00715.46
7.2.230.0070.01015.37
7.2.220.0070.01015.47
7.2.210.0040.01115.50
7.2.200.0070.00715.38
7.2.190.0100.00315.07
7.2.180.0160.00015.30
7.2.170.0060.00615.28
7.2.160.0070.00715.37
7.2.150.0090.00617.08
7.2.140.0000.01317.22
7.2.130.0040.01116.97
7.2.120.0060.01016.90
7.2.110.0090.00617.16
7.2.100.0080.00417.10
7.2.90.0100.00617.16
7.2.80.0060.00916.97
7.2.70.0030.00917.05
7.2.60.0040.01117.14
7.2.50.0030.01317.29
7.2.40.0100.00617.13
7.2.30.0000.01217.29
7.2.20.0000.01817.12
7.2.10.0070.00717.01
7.2.00.0100.00518.39
7.1.330.0100.00615.76
7.1.320.0070.00715.98
7.1.310.0000.01115.70
7.1.300.0070.01016.09
7.1.290.0000.01216.12
7.1.280.0070.00715.92
7.1.270.0070.01016.13
7.1.260.0100.00316.16
7.1.250.0110.00015.86
7.1.100.0030.01018.39
7.1.70.0030.00517.38
7.1.60.0110.01419.40
7.1.50.0030.01717.14
7.1.00.0000.07722.36
7.0.200.0040.00917.01
7.0.140.0030.07721.97
7.0.120.0070.07022.05
7.0.60.0100.04719.79
7.0.50.0070.08317.96
7.0.40.0100.07320.29
7.0.30.0470.04020.24
7.0.20.0300.08320.05
7.0.10.0100.08020.20
7.0.00.0170.07020.23
5.6.280.0100.06721.07
5.6.210.0030.04020.47
5.6.200.0070.06318.22
5.6.190.0130.04720.57
5.6.180.0270.08020.39
5.6.170.0330.04720.55
5.6.160.0100.04320.50
5.6.150.0030.06718.29
5.6.140.0100.03318.18
5.6.130.0030.08718.26
5.6.120.0100.07321.13
5.6.110.0070.05320.99
5.6.100.0070.08321.03
5.6.90.0200.07021.10
5.6.80.0000.05020.41
5.6.70.2530.03020.36
5.5.350.0030.04720.39
5.5.340.0030.04318.07
5.5.330.0100.07720.27
5.5.320.0270.07020.27
5.5.310.0230.08320.27
5.5.300.0070.03718.02
5.5.290.0070.08718.01
5.5.280.0070.04020.73
5.5.270.0030.09020.76
5.5.260.0030.04020.77
5.5.250.0030.08020.69
5.5.240.0230.03720.26
5.4.450.0030.08019.30
5.4.440.0100.07319.18
5.4.430.0130.03719.56
5.4.420.0100.03719.32
5.4.410.0070.04019.44
5.4.400.0130.07318.94
5.4.390.0030.05318.85
5.4.380.0070.04019.20
5.4.370.0070.05719.08
5.4.360.0070.04718.92
5.4.350.0130.06718.89
5.4.340.0070.03719.25
5.4.320.0070.08018.99
5.4.310.0030.05319.16
5.4.300.0030.06319.11
5.4.290.0130.05319.23
5.4.280.0070.06018.88
5.4.270.0070.07318.98
5.4.260.0000.06319.14
5.4.250.0070.06718.97
5.4.240.0070.08019.15
5.4.230.0000.07019.21
5.4.220.0070.03719.00
5.4.210.0070.06318.97
5.4.200.0070.03719.07
5.4.190.0030.03719.13
5.4.180.0070.03318.96
5.4.170.0030.03718.99
5.4.160.0030.04319.14
5.4.150.0130.02719.13
5.4.140.0000.03716.38
5.4.130.0030.03316.34
5.4.120.0070.03716.52
5.4.110.0100.03316.33
5.4.100.0000.03716.52
5.4.90.0030.03316.35
5.4.80.0030.03316.31
5.4.70.0000.03716.70
5.4.60.0070.03316.28
5.4.50.0030.03316.43
5.4.40.0030.03316.43
5.4.30.0030.03316.38
5.4.20.0030.03316.64
5.4.10.0000.03716.28
5.4.00.0000.03715.77
5.3.290.0130.07014.70
5.3.280.0100.07014.61
5.3.270.0000.04014.63
5.3.260.0000.04014.63
5.3.250.0030.03714.63
5.3.240.0100.03014.61
5.3.230.0070.03314.61
5.3.220.0070.03014.57
5.3.210.0070.03314.57
5.3.200.0030.03714.56
5.3.190.0000.04314.63
5.3.180.0000.03714.72
5.3.170.0030.03714.56
5.3.160.0000.03714.56
5.3.150.0000.04014.56
5.3.140.0000.03714.47
5.3.130.0030.03714.60
5.3.120.0070.03314.69
5.3.110.0000.05014.55
5.3.100.0100.03013.93
5.3.90.0000.03714.04
5.3.80.0200.04014.09
5.3.70.0030.03314.17
5.3.60.0000.03713.92
5.3.50.0030.03313.87
5.3.40.0030.03313.95
5.3.30.0000.03713.86
5.3.20.0030.03313.85
5.3.10.0030.03313.69
5.3.00.0000.04013.61
5.2.170.0030.03011.14
5.2.160.0000.03011.18
5.2.150.0000.03011.21
5.2.140.0070.03011.14
5.2.130.0030.02711.15
5.2.120.0070.03011.26
5.2.110.0030.02710.98
5.2.100.0000.03011.12
5.2.90.0000.06311.05
5.2.80.0070.04711.14
5.2.70.0030.03711.13
5.2.60.0030.04711.08
5.2.50.0070.03310.95
5.2.40.0000.03011.04
5.2.30.0070.05311.13
5.2.20.0030.06010.97
5.2.10.0070.05710.95
5.2.00.0000.06010.77
5.1.60.0030.0609.96
5.1.50.0030.0379.99
5.1.40.0000.0579.94
5.1.30.0070.03310.48
5.1.20.0000.06310.27
5.1.10.0070.03310.13
5.1.00.0030.03310.07
5.0.50.0070.0408.50
5.0.40.0070.0178.38
5.0.30.0030.0638.13
5.0.20.0000.0308.18
5.0.10.0030.0378.08
5.0.00.0000.0408.07
4.4.90.0000.0307.88
4.4.80.0030.0137.88
4.4.70.0000.0177.88
4.4.60.0030.0137.88
4.4.50.0000.0407.88
4.4.40.0030.0577.88
4.4.30.0100.0177.88
4.4.20.0000.0377.88
4.4.10.0030.0137.88
4.4.00.0070.0237.88
4.3.110.0000.0407.88
4.3.100.0000.0277.88
4.3.90.0100.0277.88
4.3.80.0000.0607.88
4.3.70.0000.0177.88
4.3.60.0070.0137.88
4.3.50.0030.0237.88
4.3.40.0000.0537.88
4.3.30.0000.0307.88
4.3.20.0030.0277.88
4.3.10.0070.0137.88
4.3.00.0030.0337.88

preferences:
44.23 ms | 400 KiB | 5 Q