3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Demo { public function __construct(DateTimeInterface $dateTime) { $this->date = $dateTime; } public function getDateTime(): DateTimeInterface { return $this->date; } public function echo() { echo $this->date->format("d/m/Y h:i:s"); } } $demo = new Demo(new DateTime()); $demo->echo()."\n"; $demo->getDateTime()->add(new DateInterval('P1D')); $demo->echo();

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.70.0040.01118.53
8.3.60.0130.00918.53
8.3.50.0120.00318.18
8.3.40.0160.00319.22
8.3.30.0150.00018.94
8.3.20.0080.00019.25
8.3.10.0080.00021.73
8.3.00.0050.00320.71
8.2.180.0110.00418.66
8.2.170.0120.00322.96
8.2.160.0040.01122.08
8.2.150.0040.00424.18
8.2.140.0090.00024.66
8.2.130.0050.00318.28
8.2.120.0000.00826.35
8.2.110.0070.00322.37
8.2.100.0040.00818.03
8.2.90.0080.00018.00
8.2.80.0030.00617.97
8.2.70.0050.00517.91
8.2.60.0060.00318.16
8.2.50.0030.00618.10
8.2.40.0000.00819.31
8.2.30.0000.00719.26
8.2.20.0000.00818.01
8.2.10.0040.00418.13
8.2.00.0000.01117.79
8.1.280.0000.01625.92
8.1.270.0050.00319.00
8.1.260.0080.00026.35
8.1.250.0050.00228.09
8.1.240.0030.00622.14
8.1.230.0080.00417.46
8.1.220.0000.00817.77
8.1.210.0080.00018.77
8.1.200.0060.00317.50
8.1.190.0040.00417.60
8.1.180.0080.00018.10
8.1.170.0040.00418.46
8.1.160.0040.00418.96
8.1.150.0020.00518.96
8.1.140.0030.00322.15
8.1.130.0070.00020.26
8.1.120.0040.00317.68
8.1.110.0080.00017.55
8.1.100.0050.00217.58
8.1.90.0050.00317.62
8.1.80.0050.00317.58
8.1.70.0000.00717.64
8.1.60.0030.00517.62
8.1.50.0050.00217.55
8.1.40.0040.00417.53
8.1.30.0000.00817.81
8.1.20.0040.00417.75
8.1.10.0030.00617.74
8.1.00.0040.00417.66
8.0.300.0080.00018.77
8.0.290.0090.00016.88
8.0.280.0000.00718.52
8.0.270.0000.00717.26
8.0.260.0040.00418.52
8.0.250.0080.00017.00
8.0.240.0030.00317.21
8.0.230.0040.00417.21
8.0.220.0030.00817.22
8.0.210.0040.00417.09
8.0.200.0040.00417.29
8.0.190.0000.00817.23
8.0.180.0050.00217.09
8.0.170.0050.00317.11
8.0.160.0000.00717.12
8.0.150.0040.00717.01
8.0.140.0000.00717.12
8.0.130.0000.00513.51
8.0.120.0040.00417.04
8.0.110.0040.00417.21
8.0.100.0070.00017.10
8.0.90.0020.00517.15
8.0.80.0050.01017.18
8.0.70.0080.00017.04
8.0.60.0000.00816.93
8.0.50.0040.00417.08
8.0.30.0080.00817.49
8.0.20.0140.00617.40
8.0.10.0040.00417.00
8.0.00.0110.00917.16
7.4.330.0000.00515.55
7.4.320.0060.00016.64
7.4.300.0000.00616.61
7.4.290.0050.00216.66
7.4.280.0000.00716.73
7.4.270.0000.00716.74
7.4.260.0000.00816.74
7.4.250.0040.00416.52
7.4.240.0030.00316.60
7.4.230.0070.00016.75
7.4.220.0000.00816.65
7.4.210.0070.00916.73
7.4.200.0070.00016.54
7.4.160.0120.00716.62
7.4.140.0080.01417.86
7.4.130.0040.01316.80
7.4.120.0110.00816.61
7.4.110.0100.01016.69
7.4.100.0100.01016.62
7.4.90.0110.00716.46
7.4.80.0170.00719.39
7.4.70.0140.00616.56
7.4.60.0090.00916.56
7.4.50.0070.00716.70
7.4.40.0110.00516.63
7.4.00.0090.00615.37
7.3.330.0000.00613.36
7.3.320.0060.00013.41
7.3.310.0060.00316.34
7.3.300.0030.00316.40
7.3.290.0040.00416.25
7.3.280.0070.01316.48
7.3.260.0110.00816.67
7.3.240.0100.00816.54
7.3.230.0170.00016.49
7.3.210.0070.01016.70
7.3.200.0070.01016.56
7.3.190.0060.01716.53
7.3.180.0060.01016.61
7.3.170.0080.00816.49
7.3.160.0130.00316.45
7.3.10.0140.00016.36
7.3.00.0040.01016.28
7.2.330.0060.01216.50
7.2.320.0140.00316.74
7.2.310.0100.00716.91
7.2.300.0060.00916.74
7.2.290.0070.01116.61
7.2.130.0120.01216.92
7.2.120.0090.00916.79
7.2.110.0030.01016.76
7.2.100.0040.01216.58
7.2.90.0100.00616.64
7.2.80.0080.00616.48
7.2.70.0100.00617.07
7.2.60.0180.00516.72
7.2.50.0120.00917.12
7.2.40.0120.00716.78
7.2.30.0140.00716.98
7.2.20.0120.00416.68
7.2.10.0090.00716.95
7.2.00.0060.01017.06
7.1.250.0060.00615.78
7.1.230.0100.00315.55
7.1.220.0130.00315.76
7.1.210.0080.00815.70
7.1.200.0080.00616.09
7.1.190.0040.00815.84
7.1.180.0040.01115.94
7.1.170.0060.01015.85
7.1.160.0060.00616.06
7.1.150.0030.01015.89
7.1.140.0070.00715.93
7.1.130.0130.00316.00
7.1.120.0090.00615.77
7.1.110.0060.00615.66
7.1.100.0030.01015.78
7.1.90.0120.00015.82
7.1.80.0040.01016.05
7.1.70.0080.00815.94
7.1.60.0240.00634.00
7.1.50.0220.01033.73
7.1.40.0420.00633.88
7.1.30.0170.01733.95
7.1.20.0220.00933.82
7.1.10.0070.00915.66
7.1.00.0040.01115.79
5.6.380.0090.00314.19

preferences:
61.56 ms | 401 KiB | 5 Q