3v4l.org

run code in 300+ PHP versions simultaneously
<?php function converterData($format, $to_format, $time, $timezone = null) { $version = explode('.', phpversion()); if(!$timezone) { $timezone = new DateTimeZone(date_default_timezone_get()); } if(((int)$version[0] >= 5 && (int)$version[1] >= 2 && (int)$version[2] > 17)) { $datetime = DateTime::createFromFormat($format, $time, $timezone); } else { $datetime = new DateTime(date($format, strtotime($time)), $timezone); } return $datetime->format($to_format); } var_dump(converterData('Y-m-d', 'd/m/Y', '2013-02-29'));

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)
7.3.10.0190.00516.70
7.3.00.0120.00816.26
7.2.130.0090.00916.53
7.2.120.0150.00816.75
7.2.110.0160.00416.28
7.2.100.0060.00916.75
7.2.90.0140.01116.69
7.2.80.0100.00716.52
7.2.70.0150.00816.70
7.2.60.0130.00916.64
7.2.50.0160.00717.02
7.2.40.0160.00816.68
7.2.30.0170.00817.12
7.2.20.0130.00816.41
7.2.10.0170.00016.41
7.2.00.0090.00616.88
7.1.250.0170.00016.00
7.1.70.0070.00717.40
7.1.60.0070.01319.82
7.1.50.0140.00716.86
7.1.00.0030.04322.31
7.0.200.0060.00317.13
7.0.140.0070.06722.12
7.0.100.0370.05719.98
7.0.90.0300.07720.04
7.0.80.0200.07719.96
7.0.70.0100.08319.87
7.0.60.0130.05320.00
7.0.50.0300.04020.25
7.0.40.0100.08020.05
7.0.30.0030.05320.12
7.0.20.0030.08020.17
7.0.10.0100.06320.10
7.0.00.0070.05720.11
5.6.280.0030.07320.89
5.6.250.0030.04320.63
5.6.240.0070.08720.64
5.6.230.0130.05320.75
5.6.220.0100.06020.63
5.6.210.0100.07020.49
5.6.200.0100.04721.05
5.6.190.0100.04321.06
5.6.180.0100.08021.04
5.6.170.0130.08021.05
5.6.160.0070.08021.11
5.6.150.0070.08021.13
5.6.140.0070.08321.06
5.6.130.0130.07721.17
5.6.120.0130.06721.07
5.6.110.0030.05320.92
5.6.100.0030.05321.04
5.6.90.0130.06720.92
5.6.80.0070.07320.42
5.6.70.0130.05720.46
5.6.60.0070.04720.51
5.6.50.0130.07720.41
5.6.40.0070.06320.41
5.6.30.0100.07320.30
5.6.20.0070.07020.38
5.6.10.0100.07320.49
5.6.00.0030.06720.28
5.5.380.0170.07020.40
5.5.370.0100.05020.45
5.5.360.0030.05320.50
5.5.350.0100.07720.42
5.5.340.0070.07320.87
5.5.330.0030.06020.84
5.5.320.0030.08720.86
5.5.310.0030.07720.77
5.5.300.0100.07720.87
5.5.290.0170.08720.76
5.5.280.0070.06020.75
5.5.270.0100.04720.73
5.5.260.0130.06720.75
5.5.250.0130.05020.64
5.5.240.0170.07320.27
5.5.230.0130.06720.17
5.5.220.0170.04020.16
5.5.210.0070.07320.26
5.5.200.0030.08320.08
5.5.190.0130.08020.14
5.5.180.0170.07020.11
5.5.160.0100.07720.27
5.5.150.0100.07020.08
5.5.140.0070.05020.27
5.5.130.0300.02320.27
5.5.120.0100.04020.25
5.5.110.0130.06720.14
5.5.100.0130.06020.15
5.5.90.0100.07019.98
5.5.80.0070.05720.16
5.5.70.0030.08019.97
5.5.60.0070.07320.05
5.5.50.0170.06720.00
5.5.40.0030.05320.00
5.5.30.0170.07320.00
5.5.20.0070.08020.14
5.5.10.0100.03720.04
5.5.00.0070.04319.95
5.4.450.0070.07319.22
5.4.440.0130.07319.45
5.4.430.0100.04319.53
5.4.420.0000.05319.48
5.4.410.0000.05719.32
5.4.400.0100.04719.05
5.4.390.0030.07319.13
5.4.380.0130.08018.90
5.4.370.0030.08319.13
5.4.360.0030.07719.12
5.4.350.0030.05319.03
5.4.340.0100.06318.95
5.4.320.0130.06319.18
5.4.310.0100.05718.86
5.4.300.0070.07719.14
5.4.290.0170.07019.18
5.4.280.0030.04719.20
5.4.270.0100.03719.04
5.4.260.0070.08018.84
5.4.250.0100.05319.09
5.4.240.0100.05718.87
5.4.230.0130.06019.23
5.4.220.0030.08318.95
5.4.210.0030.04719.04
5.4.200.0130.07719.11
5.4.190.0030.08018.89
5.4.180.0070.07718.93
5.4.170.0030.05018.93
5.4.160.0130.06718.83
5.4.150.0070.05319.03
5.4.140.0130.06716.34
5.4.130.0030.03716.42
5.4.120.0000.07316.45
5.4.110.0030.04016.32
5.4.100.0070.05716.50
5.4.90.0100.07316.46
5.4.80.0100.03716.45
5.4.70.0100.05716.37
5.4.60.0070.06716.41
5.4.50.0070.06316.32
5.4.40.0000.07016.46
5.4.30.0000.06016.30
5.4.20.0000.05016.40
5.4.10.0070.03716.43
5.4.00.0170.06315.90
5.3.290.0100.07314.72
5.3.280.0070.08314.70
5.3.270.0070.07014.57
5.3.260.0070.06714.67
5.3.250.0130.06714.66
5.3.240.0030.03714.53
5.3.230.0030.05014.73
5.3.220.0170.06314.49
5.3.210.0130.06714.59
5.3.200.0130.06314.59
5.3.190.0030.04014.59
5.3.180.0070.07714.70
5.3.170.0030.04314.70
5.3.160.0070.07014.67
5.3.150.0100.04014.49
5.3.140.0100.07714.62
5.3.130.0130.06014.61
5.3.120.0030.05014.66
5.3.110.0030.06314.47
5.3.100.0030.08014.18
5.3.90.0070.07714.15
5.3.80.0100.07014.14
5.3.70.0070.05314.02
5.3.60.0100.07013.89
5.3.50.0130.06014.01
5.3.40.0100.04013.93
5.3.30.0100.07314.03
5.3.20.0100.06713.82
5.3.10.0100.06713.68
5.3.00.0130.06313.74
5.2.170.0000.04311.38
5.2.160.0000.04011.38
5.2.150.0000.05011.38
5.2.140.0030.05011.38
5.2.130.0070.06011.38
5.2.120.0070.05311.38
5.2.110.0130.02311.38
5.2.100.0030.03311.38
5.2.90.0030.05011.38
5.2.80.0070.05311.38
5.2.70.0070.02711.38
5.2.60.0100.02711.38
5.2.50.0000.05011.38
5.2.40.0000.03311.38
5.2.30.0030.03711.38
5.2.20.0070.06011.38
5.2.10.0070.04711.38
5.2.00.0000.03711.38
5.1.60.0130.04011.38
5.1.50.0070.04711.38
5.1.40.0000.05311.38
5.1.30.0100.05011.38
5.1.20.0070.05711.38
5.1.10.0100.03311.38
5.1.00.0000.03311.38
5.0.50.0030.03711.38
5.0.40.0000.02311.38
5.0.30.0130.05711.38
5.0.20.0000.03311.38
5.0.10.0070.02311.38
5.0.00.0000.05711.38
4.4.90.0000.03311.38
4.4.80.0070.03311.38
4.4.70.0030.02311.38
4.4.60.0030.03311.38
4.4.50.0000.02711.38
4.4.40.0000.05311.38
4.4.30.0000.02711.38
4.4.20.0000.03711.38
4.4.10.0100.03311.38
4.4.00.0030.02711.38
4.3.110.0000.01711.38
4.3.100.0030.02311.38
4.3.90.0100.01711.38
4.3.80.0000.03711.38
4.3.70.0030.02711.38
4.3.60.0000.03311.38
4.3.50.0070.03311.38
4.3.40.0000.04311.38
4.3.30.0000.02711.38
4.3.20.0030.02011.38
4.3.10.0000.03311.38
4.3.00.0000.01711.38

preferences:
44.79 ms | 400 KiB | 5 Q