3v4l.org

run code in 300+ PHP versions simultaneously
<?php function converteData($format, $to_format, $date, $timezone = null) { if (!$timezone) { $timezone = new DateTimeZone(date_default_timezone_get()); } $d = date_create_from_format($format, $date, $timezone); return date_format($d, $to_format); } /* * Exemplos */ var_dump(converteData('2014-02-28 12:12:12')); # true var_dump(converteData('2014-02-30 12:12:12')); # false var_dump(converteData('2014-02-28', 'Y-m-d')); # true var_dump(converteData('28/02/2014', 'd/m/Y')); # true var_dump(converteData('30/02/2014', 'd/m/Y')); # false

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.0060.01316.50
8.3.50.0110.00521.89
8.3.40.0070.00718.99
8.3.30.0030.01019.03
8.3.20.0000.00820.21
8.3.10.0030.00623.54
8.3.00.0110.00017.63
8.2.180.0120.00318.41
8.2.170.0070.00722.96
8.2.160.0070.00720.43
8.2.150.0000.00824.18
8.2.140.0040.00424.66
8.2.130.0070.00726.16
8.2.120.0000.00722.25
8.2.110.0030.00622.24
8.2.100.0060.00617.72
8.2.90.0000.00919.25
8.2.80.0040.00417.97
8.2.70.0030.00617.50
8.2.60.0030.00617.80
8.2.50.0040.00418.07
8.2.40.0040.00418.03
8.2.30.0070.00017.92
8.2.20.0070.00017.75
8.2.10.0000.00718.01
8.2.00.0070.00317.60
8.1.280.0110.00725.92
8.1.270.0070.00722.12
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0030.00623.80
8.1.230.0070.00419.16
8.1.220.0040.00417.74
8.1.210.0050.00318.77
8.1.200.0030.00617.25
8.1.190.0040.00417.15
8.1.180.0000.00818.10
8.1.170.0000.00818.38
8.1.160.0040.00421.98
8.1.150.0080.00018.44
8.1.140.0030.00617.25
8.1.130.0050.00317.79
8.1.120.0070.00017.29
8.1.110.0000.00717.34
8.1.100.0050.00317.26
8.1.90.0000.00717.37
8.1.80.0000.00717.40
8.1.70.0030.00317.23
8.1.60.0000.00817.39
8.1.50.0060.00317.46
8.1.40.0000.00717.54
8.1.30.0060.00317.58
8.1.20.0030.00617.58
8.1.10.0050.00517.54
8.1.00.0050.00317.46
8.0.300.0040.00418.77
8.0.290.0040.00417.05
8.0.280.0030.00518.33
8.0.270.0000.00717.14
8.0.260.0000.00617.21
8.0.250.0070.00016.89
8.0.240.0000.00916.88
8.0.230.0000.00816.85
8.0.220.0030.00316.78
8.0.210.0000.00716.96
8.0.200.0030.00316.88
8.0.190.0080.00016.94
8.0.180.0050.00216.93
8.0.170.0040.00416.89
8.0.160.0070.00016.89
8.0.150.0000.00716.82
8.0.140.0030.00316.89
8.0.130.0080.00013.27
8.0.120.0000.01016.85
8.0.110.0040.00416.88
8.0.100.0040.00416.75
8.0.90.0040.00416.83
8.0.80.0040.01416.91
8.0.70.0070.00016.91
8.0.60.0070.00016.93
8.0.50.0050.00316.86
8.0.30.0170.00617.13
8.0.20.0130.01117.40
8.0.10.0070.00016.95
8.0.00.0070.01216.74
7.4.330.0020.00215.00
7.4.320.0030.00316.45
7.4.300.0030.00316.53
7.4.290.0030.00316.58
7.4.280.0070.00216.46
7.4.270.0040.00416.43
7.4.260.0040.00416.52
7.4.250.0080.00016.32
7.4.240.0000.00816.46
7.4.230.0000.00716.20
7.4.220.0090.00916.48
7.4.210.0060.01016.58
7.4.200.0030.00416.65
7.4.190.0000.00716.34
7.4.160.0030.01416.55
7.4.150.0070.01517.40
7.4.140.0090.01117.86
7.4.130.0140.00316.53
7.4.120.0070.01016.62
7.4.110.0090.01516.53
7.4.100.0120.00816.55
7.4.90.0130.00316.43
7.4.80.0100.00719.39
7.4.70.0030.01416.47
7.4.60.0100.00716.39
7.4.50.0030.00516.49
7.4.40.0040.01122.77
7.4.30.0060.01016.46
7.4.00.0060.01115.00
7.3.330.0030.00313.32
7.3.320.0030.00313.39
7.3.310.0000.00716.35
7.3.300.0000.00716.31
7.3.290.0030.01716.32
7.3.280.0050.01116.31
7.3.270.0070.01017.40
7.3.260.0130.00316.33
7.3.250.0090.01216.51
7.3.240.0080.00816.48
7.3.230.0030.01216.55
7.3.210.0100.00716.34
7.3.200.0170.00019.39
7.3.190.0090.01116.29
7.3.180.0030.01616.38
7.3.170.0060.00916.48
7.3.160.0120.00416.32
7.3.120.0100.00714.66
7.3.110.0040.01514.88
7.3.100.0060.00614.77
7.3.90.0070.00714.77
7.3.80.0030.00914.82
7.3.70.0080.00414.87
7.3.60.0060.00914.66
7.3.50.0100.00714.48
7.3.40.0030.01014.64
7.3.30.0110.00314.95
7.3.20.0040.00716.30
7.3.10.0110.00416.34
7.3.00.0090.00616.43
7.2.330.0120.00616.61
7.2.320.0130.00616.66
7.2.310.0090.00916.57
7.2.300.0030.01316.55
7.2.290.0070.01016.63
7.2.250.0030.01415.06
7.2.240.0030.01414.57
7.2.230.0060.01214.86
7.2.220.0040.01115.02
7.2.210.0040.01214.98
7.2.200.0110.00715.07
7.2.190.0100.00714.98
7.2.180.0120.00315.09
7.2.170.0040.00814.93
7.2.60.0100.00316.92
7.2.00.0000.01219.30
7.1.330.0080.00615.71
7.1.320.0030.01015.63
7.1.310.0090.00615.51
7.1.300.0080.00815.35
7.1.290.0060.00915.70
7.1.280.0100.00315.37
7.1.270.0080.00815.29
7.1.260.0090.00315.71
7.1.200.0070.00315.73
7.1.100.0000.01417.83
7.1.70.0030.00516.73
7.1.60.0070.01419.33
7.1.50.0070.00716.79
7.1.00.0100.07022.39
7.0.200.0000.01016.88
7.0.140.0070.07022.21
7.0.100.0270.03019.97
7.0.90.0030.04719.98
7.0.80.0100.04019.99
7.0.70.0070.04319.93
7.0.60.0030.04320.07
7.0.50.0100.04020.28
7.0.40.0100.04020.03
7.0.30.0070.04020.09
7.0.20.0030.04020.00
7.0.10.0100.04020.05
7.0.00.0070.04020.02
5.6.280.0070.07021.13
5.6.250.0100.04020.60
5.6.240.0070.04020.69
5.6.230.0170.04720.63
5.6.220.0030.04020.73
5.6.210.0000.04320.74
5.6.200.0100.02721.04
5.6.190.0030.04021.13
5.6.180.0030.03721.00
5.6.170.0030.04721.09
5.6.160.0070.04320.95
5.6.150.0000.04321.02
5.6.140.0000.05321.11
5.6.130.0000.04720.93
5.6.120.0130.03721.08
5.6.110.0030.04321.00
5.6.100.0070.04020.98
5.6.90.0100.03321.03
5.6.80.0030.04720.56
5.6.70.0030.06020.34
5.6.60.0030.04020.34
5.6.50.0130.05320.56
5.6.40.0030.04020.43
5.6.30.0070.07720.47
5.6.20.0070.05320.36
5.6.10.0030.07020.44
5.6.00.0100.04020.36
5.5.380.0030.04320.57
5.5.370.0030.04320.50
5.5.360.0100.09020.34
5.5.350.0000.04320.45
5.5.340.0030.04320.84
5.5.330.0100.03720.93
5.5.320.0070.03720.83
5.5.310.0030.04320.88
5.5.300.0030.05720.80
5.5.290.0000.04720.93
5.5.280.0100.03320.88
5.5.270.0030.04320.88
5.5.260.0100.03720.86
5.5.250.0070.04020.57
5.5.240.0030.04020.26
5.5.230.0070.03720.14
5.5.220.0030.07020.24
5.5.210.0030.04020.25
5.5.200.0130.07020.27
5.5.190.0070.07320.28
5.5.180.0130.05720.19
5.5.160.0070.07720.20
5.5.150.0070.07320.14
5.5.140.0070.05320.23
5.5.130.0100.07720.11
5.5.120.0070.07719.99
5.5.110.0030.04320.05
5.5.100.0030.07320.08
5.5.90.0070.07320.11
5.5.80.0000.06020.15
5.5.70.0070.07719.94
5.5.60.0100.05720.14
5.5.50.0070.07020.06
5.5.40.0100.07720.08
5.5.30.0070.07320.08
5.5.20.0100.07720.13
5.5.10.0030.08320.00
5.5.00.0070.07720.04
5.4.450.0030.04019.49
5.4.440.0070.03719.27
5.4.430.0100.03319.55
5.4.420.0030.04019.36
5.4.410.0100.03019.10
5.4.400.0030.03719.13
5.4.390.0030.03719.02
5.4.380.0100.03018.88
5.4.370.0000.03719.13
5.4.360.0000.07718.90
5.4.350.0070.07719.12
5.4.340.0100.07319.11
5.4.320.0200.05718.89
5.4.310.0100.07719.09
5.4.300.0070.07018.87
5.4.290.0030.04718.95
5.4.280.0130.04019.12
5.4.270.0070.06719.12
5.4.260.0030.07719.22
5.4.250.0030.07718.87
5.4.240.0030.07318.89
5.4.230.0030.07019.13
5.4.220.0030.05319.09
5.4.210.0030.08319.11
5.4.200.0070.07718.88
5.4.190.0100.06319.12
5.4.180.0000.08319.20
5.4.170.0070.07019.08
5.4.160.0100.04318.87
5.4.150.0070.06318.83
5.4.140.0000.07716.14
5.4.130.0100.07316.14
5.4.120.0070.07316.35
5.4.110.0030.04316.48
5.4.100.0030.07316.43
5.4.90.0170.06716.27
5.4.80.0100.06716.47
5.4.70.0170.05716.38
5.4.60.0100.07016.34
5.4.50.0100.06316.36
5.4.40.0100.06316.38
5.4.30.0070.04716.36
5.4.20.0170.06316.32
5.4.10.0100.07016.47
5.4.00.0100.06715.82
5.3.290.0130.06314.70
5.3.280.0070.07314.69
5.3.270.0030.08314.59
5.3.260.0070.04714.54
5.3.250.0170.07014.67
5.3.240.0070.04714.75
5.3.230.0170.06714.63
5.3.220.0170.05014.56
5.3.210.0100.06714.59
5.3.200.0070.07314.56
5.3.190.0100.06314.59
5.3.180.0030.04314.55
5.3.170.0100.04014.57
5.3.160.0100.07014.68
5.3.150.0100.07714.55
5.3.140.0130.07314.59
5.3.130.0100.07714.51
5.3.120.0070.07714.54
5.3.110.0000.05014.61
5.3.100.0030.07314.10
5.3.90.0070.04714.08
5.3.80.0000.07313.91
5.3.70.0070.06314.04
5.3.60.0100.03714.07
5.3.50.0170.05713.94
5.3.40.0170.06313.83
5.3.30.0130.05013.97
5.3.20.0030.04313.82
5.3.10.0130.07013.71
5.3.00.0100.05013.57
5.2.170.0070.06012.62
5.2.160.0030.06312.62
5.2.150.0100.06012.62
5.2.140.0030.06312.62
5.2.130.0070.03012.62
5.2.120.0100.05012.62
5.2.110.0030.05312.62
5.2.100.0000.04012.62
5.2.90.0070.05712.62
5.2.80.0030.05712.62
5.2.70.0100.06012.62
5.2.60.0100.03012.62
5.2.50.0070.05312.62
5.2.40.0030.03312.62
5.2.30.0030.05712.62
5.2.20.0070.06312.62
5.2.10.0130.03712.62
5.2.00.0030.06312.62
5.1.60.0100.04012.62
5.1.50.0030.06312.62
5.1.40.0070.02712.62
5.1.30.0000.06012.62
5.1.20.0070.05312.62
5.1.10.0000.06012.62
5.1.00.0030.03012.62
5.0.50.0000.04712.62
5.0.40.0030.02712.62
5.0.30.0030.05312.62
5.0.20.0070.04012.62
5.0.10.0100.03712.62
5.0.00.0000.07012.62
4.4.90.0070.03012.62
4.4.80.0100.01712.62
4.4.70.0070.02312.62
4.4.60.0000.03012.62
4.4.50.0030.03312.62
4.4.40.0030.05012.62
4.4.30.0030.03712.62
4.4.20.0030.03312.62
4.4.10.0000.02312.62
4.4.00.0030.04312.62
4.3.110.0000.03712.62
4.3.100.0000.03712.62
4.3.90.0070.03312.62
4.3.80.0000.05312.62
4.3.70.0000.02312.62
4.3.60.0030.03012.62
4.3.50.0030.03312.62
4.3.40.0070.04712.62
4.3.30.0030.03312.62
4.3.20.0070.02712.62
4.3.10.0000.02712.62
4.3.00.0030.03312.62

preferences:
40.56 ms | 401 KiB | 5 Q