3v4l.org

run code in 300+ PHP versions simultaneously
<?php class C{ protected $date; public function __construct(){ $this->date=new DateTime(); } public function getCurrent(){ return clone $this->date; } } class A extends C{ public function getDate(){ return $this->getCurrent()->add(new DateInterval('P10D')); } public function getDateAgain(){ return $this->getCurrent()->add(new DateInterval('P10D')); } } class B extends C{ public function getDate(){ return $this->getCurrent()->add(new DateInterval('P20D')); } } $a=new A(); $b=new B(); echo $a->getDate()->format('Y-m-d') . "\n"; echo $b->getDate()->format('Y-m-d') . "\n"; echo $a->getDateAgain()->format('Y-m-d') . "\n";

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.01116.86
8.3.60.0070.00716.88
8.3.50.0120.00316.52
8.3.40.0090.00618.73
8.3.30.0090.00918.70
8.3.20.0000.00720.34
8.3.10.0000.00723.65
8.3.00.0070.00023.51
8.2.190.0120.00316.75
8.2.180.0120.00918.14
8.2.170.0120.00622.96
8.2.160.0130.00320.38
8.2.150.0140.00424.18
8.2.140.0040.00424.66
8.2.130.0090.00022.21
8.2.120.0070.00026.35
8.2.110.0000.01021.00
8.2.100.0110.00018.22
8.2.90.0030.00519.22
8.2.80.0080.00018.05
8.2.70.0030.00517.88
8.2.60.0030.00617.93
8.2.50.0000.00818.10
8.2.40.0040.00420.60
8.2.30.0100.00019.39
8.2.20.0040.00418.12
8.2.10.0040.00418.07
8.2.00.0060.00318.07
8.1.280.0120.00325.92
8.1.270.0040.00423.83
8.1.260.0070.00026.35
8.1.250.0040.00428.09
8.1.240.0040.00724.01
8.1.230.0100.00017.64
8.1.220.0030.00517.74
8.1.210.0040.00418.77
8.1.200.0090.00017.48
8.1.190.0040.00419.26
8.1.180.0000.00718.10
8.1.170.0080.00018.77
8.1.160.0040.00419.11
8.1.150.0000.00718.90
8.1.140.0030.00617.69
8.1.130.0000.00719.07
8.1.120.0070.00017.67
8.1.110.0040.00417.72
8.1.100.0040.00417.67
8.1.90.0070.00017.54
8.1.80.0070.00317.65
8.1.70.0000.00817.55
8.1.60.0000.00817.73
8.1.50.0090.00017.67
8.1.40.0060.00317.67
8.1.30.0040.00417.73
8.1.20.0050.00217.80
8.1.10.0040.00417.61
8.1.00.0000.00817.71
8.0.300.0000.00818.77
8.0.290.0070.00016.88
8.0.280.0030.00318.66
8.0.270.0000.00717.20
8.0.260.0030.00318.91
8.0.250.0050.00217.16
8.0.240.0000.00617.14
8.0.230.0030.00317.20
8.0.220.0070.00017.04
8.0.210.0040.00417.13
8.0.200.0000.00717.18
8.0.190.0040.00417.11
8.0.180.0040.00417.07
8.0.170.0000.01117.09
8.0.160.0030.00317.13
8.0.150.0000.01016.97
8.0.140.0060.00316.97
8.0.130.0000.00613.47
8.0.120.0000.00916.95
8.0.110.0050.00317.08
8.0.100.0000.00817.07
8.0.90.0040.00417.04
8.0.80.0060.00916.98
8.0.70.0060.00317.08
8.0.60.0000.00816.88
8.0.50.0030.00517.13
8.0.30.0110.00617.14
8.0.20.0080.01117.43
8.0.10.0030.00616.98
8.0.00.0040.01316.77
7.4.330.0000.00715.55
7.4.320.0000.00616.64
7.4.300.0060.00016.57
7.4.290.0040.00416.74
7.4.280.0000.00716.64
7.4.270.0040.00416.64
7.4.260.0120.00016.72
7.4.250.0040.00416.57
7.4.240.0000.00716.63
7.4.230.0030.00516.82
7.4.220.0060.01216.54
7.4.210.0050.01016.65
7.4.200.0000.00816.73
7.4.160.0100.00816.67
7.4.150.0110.00717.40
7.4.140.0110.00817.86
7.4.130.0190.01316.63
7.4.120.0100.00716.83
7.4.110.0090.00616.75
7.4.100.0040.01216.79
7.4.90.0100.00716.73
7.4.80.0090.00819.39
7.4.70.0110.01116.64
7.4.60.0070.01116.64
7.4.50.0030.00916.76
7.4.40.0110.00716.61
7.4.30.0090.00616.66
7.4.10.0120.00314.82
7.4.00.0040.01215.08
7.3.330.0000.00513.41
7.3.320.0000.00613.21
7.3.310.0040.00416.30
7.3.300.0030.00316.33
7.3.290.0040.00416.46
7.3.280.0110.00716.43
7.3.270.0090.00917.40
7.3.260.0090.01016.51
7.3.250.0080.00916.60
7.3.240.0130.00616.64
7.3.230.0150.00316.58
7.3.210.0070.01016.56
7.3.200.0080.00816.57
7.3.190.0030.01316.54
7.3.180.0160.00016.81
7.3.170.0060.00916.64
7.3.160.0060.01616.47
7.3.130.0040.01214.86
7.3.120.0090.00614.67
7.3.110.0110.00715.02
7.3.100.0040.01115.03
7.3.90.0060.00814.98
7.3.80.0090.00014.83
7.3.70.0000.01315.14
7.3.60.0060.00614.98
7.3.50.0040.01115.08
7.3.40.0040.00714.99
7.3.30.0030.00615.00
7.3.20.0050.00516.62
7.3.10.0060.00916.69
7.3.00.0000.01016.74
7.2.330.0070.01116.66
7.2.320.0120.00616.50
7.2.310.0090.01516.99
7.2.300.0160.00316.72
7.2.290.0130.00516.71
7.2.260.0030.01315.23
7.2.250.0060.01215.16
7.2.240.0030.01015.15
7.2.230.0030.01315.34
7.2.220.0070.00315.23
7.2.210.0000.00915.44
7.2.200.0070.00715.10
7.2.190.0090.00615.32
7.2.180.0030.00615.30
7.2.170.0030.01215.23
7.2.160.0000.01415.12
7.2.150.0070.01117.10
7.2.140.0040.00817.04
7.2.130.0060.01017.15
7.2.120.0090.00016.91
7.2.110.0100.00116.87
7.2.100.0060.00916.88
7.2.90.0070.00717.32
7.2.80.0070.01016.85
7.2.70.0000.00917.03
7.2.60.0180.00716.97
7.2.50.0090.00617.12
7.2.40.0070.01017.16
7.2.30.0060.00617.20
7.2.20.0030.01017.03
7.2.10.0000.01516.66
7.2.00.0000.01217.08
7.1.330.0040.00916.02
7.1.320.0000.01915.67
7.1.310.0000.01516.02
7.1.300.0080.00415.85
7.1.290.0070.00715.88
7.1.280.0030.01415.98
7.1.270.0060.00615.67
7.1.260.0040.00715.99
7.1.250.0000.01115.93
7.1.240.0080.00815.69
7.1.230.0030.00915.89
7.1.220.0070.00715.68
7.1.210.0050.00516.02
7.1.200.0070.00715.79
7.1.190.0030.00915.80
7.1.180.0030.01015.90
7.1.170.0080.00815.79
7.1.160.0070.00715.89
7.1.150.0100.00315.71
7.1.140.0100.00715.84
7.1.130.0000.01515.67
7.1.120.0040.00815.98
7.1.110.0150.00715.89
7.1.100.0200.00815.98
7.1.90.0110.00915.87
7.1.80.0110.00816.14
7.1.70.0170.00915.61
7.1.60.0180.01124.80
7.1.50.0210.00824.49
7.1.40.0230.01124.13
7.1.30.0160.00824.23
7.1.20.0240.01124.36
7.1.10.0130.01315.37
7.1.00.0120.00715.38
7.0.330.0000.01015.65
7.0.320.0050.00315.56
7.0.310.0070.00715.63
7.0.300.0040.01115.20
7.0.290.0100.00015.60
7.0.280.0030.01015.38
7.0.270.0160.00015.64
7.0.260.0070.01015.68
7.0.250.0120.00715.67
7.0.240.0160.01115.48
7.0.230.0100.01315.59
7.0.220.0190.00716.02
7.0.210.0200.00515.07
7.0.200.0160.00815.35
7.0.190.0160.01115.30
7.0.180.0190.00815.16
7.0.170.0200.00515.13
7.0.160.0100.00915.23
7.0.150.0080.00615.23
7.0.140.0100.01115.10
7.0.130.0200.00915.28
7.0.120.0370.00715.25
7.0.110.0130.00614.98
7.0.100.0180.00415.07
7.0.90.0120.00715.19
7.0.80.0110.01015.15
7.0.70.0140.00715.14
7.0.60.0150.01214.87
7.0.50.0020.01215.22
7.0.40.0290.00914.23
7.0.30.0080.00814.21
7.0.20.0160.00814.03
7.0.10.0370.01014.14
7.0.00.0250.00514.20
5.6.400.0060.00614.39
5.6.390.0030.00914.28
5.6.380.0000.00914.67
5.6.370.0000.00914.59
5.6.360.0060.00314.49
5.6.350.0030.01114.50
5.6.340.0120.00314.51
5.6.330.0060.00314.50
5.6.320.0040.00414.89
5.6.310.0030.00914.84
5.6.300.0040.00414.17
5.6.290.0060.00314.59
5.6.280.0060.00314.83
5.6.270.0100.00014.62
5.6.260.0030.00914.59
5.6.250.0070.00714.41
5.6.240.0030.00614.40
5.6.230.0000.01414.35
5.6.220.0040.01414.56
5.6.210.0070.00714.33
5.6.200.0000.01114.47
5.6.190.0090.00314.66
5.6.180.0030.01014.70
5.6.170.0030.01014.48
5.6.160.0000.01814.46
5.6.150.0000.01814.43
5.6.140.0040.01514.37
5.6.130.0090.00314.56
5.6.120.0030.01014.23
5.6.110.0000.01214.57
5.6.100.0040.01214.65
5.6.90.0110.00314.42
5.6.80.0040.01214.37
5.6.70.0040.00414.44
5.6.60.0110.00714.69
5.6.50.0050.00514.73
5.6.40.0070.01114.30
5.6.30.0060.00614.44
5.6.20.0030.00914.33
5.6.10.0000.01114.43
5.6.00.0040.00814.73

preferences:
62.09 ms | 401 KiB | 5 Q