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('d m Y', 'Y-m-d', '06 02 2025')); //2025-02-06 var_dump(converteData('d-m-Y', 'm/d/Y H:i', '06-02-2025')); //2025-02-06 var_dump(converteData('Y-m-d', 'D l F Y', '2014-02-06')); //Thu Thursday February 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.0030.01618.43
8.3.50.0060.01121.15
8.3.40.0040.01118.86
8.3.30.0100.00318.91
8.3.20.0060.00320.18
8.3.10.0040.00421.89
8.3.00.0040.00422.45
8.2.180.0060.01318.14
8.2.170.0100.00722.96
8.2.160.0140.00320.47
8.2.150.0080.00024.18
8.2.140.0170.00324.66
8.2.130.0100.00726.16
8.2.120.0090.00019.76
8.2.110.0030.00621.02
8.2.100.0040.00817.91
8.2.90.0000.00719.22
8.2.80.0040.00418.05
8.2.70.0060.00317.59
8.2.60.0000.00818.03
8.2.50.0060.00318.07
8.2.40.0030.00518.34
8.2.30.0000.00718.04
8.2.20.0070.00017.82
8.2.10.0000.00817.95
8.2.00.0000.00717.88
8.1.280.0070.00725.92
8.1.270.0060.00320.39
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0030.00623.78
8.1.230.0130.00320.89
8.1.220.0040.00417.79
8.1.210.0080.00018.77
8.1.200.0030.00617.35
8.1.190.0000.00817.40
8.1.180.0030.00518.75
8.1.170.0030.00618.52
8.1.160.0000.00722.07
8.1.150.0000.00718.67
8.1.140.0000.00817.59
8.1.130.0000.00717.93
8.1.120.0040.00417.64
8.1.110.0000.00917.50
8.1.100.0040.00417.57
8.1.90.0000.00717.59
8.1.80.0070.00017.54
8.1.70.0030.00317.52
8.1.60.0030.00617.65
8.1.50.0080.00017.48
8.1.40.0050.00217.57
8.1.30.0050.00317.70
8.1.20.0040.00417.75
8.1.10.0050.00317.45
8.1.00.0000.00817.42
8.0.300.0040.00418.77
8.0.290.0000.00717.29
8.0.280.0000.00818.46
8.0.270.0030.00317.28
8.0.260.0030.00317.08
8.0.250.0060.00017.04
8.0.240.0050.00217.18
8.0.230.0000.00717.13
8.0.220.0040.00417.09
8.0.210.0040.00417.09
8.0.200.0000.00717.21
8.0.190.0000.00717.11
8.0.180.0040.00417.01
8.0.170.0000.00817.00
8.0.160.0000.00717.14
8.0.150.0000.00816.97
8.0.140.0000.00716.90
8.0.130.0000.00613.41
8.0.120.0090.00017.09
8.0.110.0040.00417.02
8.0.100.0050.00316.96
8.0.90.0000.00817.03
8.0.80.0090.00617.13
8.0.70.0000.00817.15
8.0.60.0030.00417.05
8.0.50.0040.00416.96
8.0.30.0120.01017.26
8.0.20.0120.00717.41
8.0.10.0040.00417.20
8.0.00.0090.00816.75
7.4.330.0000.00515.00
7.4.320.0060.00016.67
7.4.300.0000.00716.68
7.4.290.0000.00716.63
7.4.280.0040.00316.58
7.4.270.0020.00516.72
7.4.260.0070.00016.55
7.4.250.0000.00716.55
7.4.240.0010.00616.65
7.4.230.0070.00016.52
7.4.220.0060.01316.64
7.4.210.0060.01016.68
7.4.200.0070.00016.52
7.4.190.0000.00716.80
7.4.160.0060.00916.90
7.4.150.0130.00617.40
7.4.140.0100.01017.86
7.4.130.0100.00816.74
7.4.120.0130.00716.74
7.4.110.0110.00716.56
7.4.100.0100.00716.56
7.4.90.0070.01016.63
7.4.80.0120.00719.39
7.4.70.0120.00616.47
7.4.60.0030.01316.57
7.4.50.0000.00816.63
7.4.40.0090.00622.77
7.4.30.0150.00416.68
7.4.00.0090.00614.98
7.3.330.0050.00013.44
7.3.320.0000.00513.41
7.3.310.0020.00516.53
7.3.300.0030.00316.44
7.3.290.0110.00916.45
7.3.280.0070.01116.38
7.3.270.0100.00717.40
7.3.260.0110.00716.46
7.3.250.0140.00816.48
7.3.240.0100.00716.44
7.3.230.0070.01116.55
7.3.210.0060.01616.69
7.3.200.0070.01019.39
7.3.190.0130.01016.38
7.3.180.0090.00916.46
7.3.170.0090.00616.52
7.3.160.0160.00016.79
7.3.120.0060.00914.74
7.2.330.0120.00616.96
7.2.320.0140.00416.63
7.2.310.0100.00716.63
7.2.300.0110.00416.92
7.2.290.0120.00916.63
7.2.80.0000.01416.89
7.2.60.0000.01117.07
7.2.00.0130.00719.44
7.1.200.0030.01015.57
7.1.100.0080.00318.25
7.1.70.0000.01117.25
7.1.60.0030.02019.82
7.1.50.0060.01617.13
7.1.00.0000.05022.35
7.0.200.0070.00316.66
7.0.140.0000.07722.09
7.0.60.0100.07719.92
7.0.50.0070.04017.86
7.0.40.0030.05020.40
7.0.30.0230.06720.33
7.0.20.0200.04020.16
7.0.10.0400.07020.14
7.0.00.0070.04020.25
5.6.280.0070.07021.11
5.6.210.0070.03720.57
5.6.200.0030.04318.29
5.6.190.0130.06720.54
5.6.180.3000.04720.63
5.6.170.0300.06720.47
5.6.160.0070.04020.50
5.6.150.0070.06318.17
5.6.140.0130.06318.16
5.6.130.0000.08018.18
5.6.120.0030.08720.98
5.6.110.0030.04321.09
5.6.100.0070.08321.05
5.6.90.0100.08021.00
5.6.80.0070.03720.29
5.5.350.0170.07020.36
5.5.340.0030.08017.95
5.5.330.0070.06320.21
5.5.320.0130.07020.25
5.5.310.0200.08320.32
5.5.300.0100.08017.95
5.5.290.0070.08718.04
5.5.280.0070.05320.75
5.5.270.0130.04720.76
5.5.260.0070.08320.77
5.5.250.0030.05720.58
5.5.240.0100.03720.25
5.4.450.0670.06019.59
5.4.440.0730.06319.73
5.4.430.0300.05019.17
5.4.420.0830.05319.46
5.4.410.0870.07019.06
5.4.400.0630.05718.61
5.4.390.0630.05018.79
5.4.380.0270.05718.76
5.4.370.0270.03718.61
5.4.360.0130.05018.75
5.4.350.0080.04712.02
5.4.340.0120.04412.02
5.4.320.0070.04812.50
5.4.310.0030.04012.50
5.4.300.0050.03812.51
5.4.290.0060.03912.50
5.4.280.0040.03612.40
5.4.270.0080.03712.40
5.4.260.0070.03612.40
5.4.250.0030.05718.98
5.4.240.0130.07318.73
5.4.230.0130.04318.78
5.4.220.0130.04718.96
5.4.210.0070.05018.71
5.4.200.0100.04718.91
5.4.190.0000.05718.97
5.4.180.0130.04318.91
5.4.170.0070.05018.95
5.4.160.0030.05318.75
5.4.150.0100.04718.89
5.4.140.0130.04316.58
5.4.130.0070.04716.38
5.4.120.0100.04316.36
5.4.110.0070.05016.47
5.4.100.0030.06016.34
5.4.90.0130.05316.33
5.4.80.0070.05016.54
5.4.70.0030.05316.39
5.4.60.0100.04316.38
5.4.50.0030.06316.36
5.4.40.0070.05716.48
5.4.30.0130.05316.27
5.4.20.0070.04716.30
5.4.10.0100.05316.46
5.4.00.0130.04015.82
5.3.290.0100.03612.80
5.3.280.0130.04314.58
5.3.270.0000.05714.79
5.3.260.0070.05314.46
5.3.250.0130.04314.74
5.3.240.0130.04314.59
5.3.230.0030.05314.78
5.3.220.0030.05014.79
5.3.210.0100.04714.70
5.3.200.0000.05314.41
5.3.190.0030.05314.57
5.3.180.0070.05014.59
5.3.170.0070.05014.55
5.3.160.0030.05014.70
5.3.150.0100.05014.73
5.3.140.0170.06014.53
5.3.130.0100.06314.55
5.3.120.0170.06314.64
5.3.110.0130.04714.61
5.3.100.0100.04714.12
5.3.90.0130.04014.14
5.3.80.0070.05014.23
5.3.70.0070.04713.93
5.3.60.0100.05714.07
5.3.50.0000.05314.04
5.3.40.0100.06014.11
5.3.30.0170.03714.09
5.3.20.0070.04313.67
5.3.10.0070.04713.73
5.3.00.0070.04713.73
5.2.170.0000.04311.24
5.2.160.0100.05711.22
5.2.150.0030.04311.11
5.2.140.0070.04011.14
5.2.130.0100.03311.32
5.2.120.0070.04011.28
5.2.110.0070.04011.18
5.2.100.0070.03711.32
5.2.90.0070.03711.26
5.2.80.0030.04311.27
5.2.70.0030.04711.17
5.2.60.0000.04711.02
5.2.50.0100.04311.02
5.2.40.0000.04711.05
5.2.30.0130.05311.02
5.2.20.0030.04010.94
5.2.10.0130.03010.84
5.2.00.0100.03710.70
5.1.60.0030.03310.02
5.1.50.0070.03310.04
5.1.40.0030.0339.98
5.1.30.0070.03310.41
5.1.20.0030.03710.34
5.1.10.0030.03710.27
5.1.00.0130.03010.22
5.0.50.0030.0378.61
5.0.40.0000.0308.65
5.0.30.0100.0338.28
5.0.20.0000.0308.18
5.0.10.0000.0338.27
5.0.00.0130.0408.21
4.4.90.0000.0306.31
4.4.80.0000.0236.31
4.4.70.0030.0206.31
4.4.60.0030.0206.31
4.4.50.0070.0176.31
4.4.40.0000.0376.31
4.4.30.0070.0176.31
4.4.20.0000.0236.31
4.4.10.0000.0236.31
4.4.00.0070.0306.31
4.3.110.0000.0236.31
4.3.100.0000.0236.31
4.3.90.0000.0236.31
4.3.80.0030.0336.31
4.3.70.0070.0176.31
4.3.60.0100.0136.31
4.3.50.0000.0236.31
4.3.40.0030.0336.31
4.3.30.0000.0236.31
4.3.20.0100.0136.31
4.3.10.0070.0206.31
4.3.00.0130.0237.11

preferences:
40.91 ms | 401 KiB | 5 Q