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 $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.60.0100.00617.00
8.3.50.0070.00716.45
8.3.40.0080.00819.01
8.3.30.0110.00418.92
8.3.20.0080.00020.20
8.3.10.0040.00423.61
8.3.00.0000.00823.52
8.2.180.0100.01018.79
8.2.170.0120.00318.97
8.2.160.0110.00722.96
8.2.150.0000.00825.66
8.2.140.0040.00424.66
8.2.130.0040.00420.22
8.2.120.0040.00426.35
8.2.110.0070.00320.95
8.2.100.0080.00318.09
8.2.90.0080.00019.22
8.2.80.0050.00318.16
8.2.70.0040.00417.88
8.2.60.0050.00317.80
8.2.50.0000.00818.10
8.2.40.0040.00420.46
8.2.30.0030.00619.13
8.2.20.0030.00518.13
8.2.10.0040.00417.98
8.2.00.0040.00418.07
8.1.280.0100.00725.92
8.1.270.0000.00824.01
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0090.00023.97
8.1.230.0090.00317.64
8.1.220.0030.00617.74
8.1.210.0080.00018.77
8.1.200.0060.00317.38
8.1.190.0060.00319.26
8.1.180.0060.00318.10
8.1.170.0030.00518.71
8.1.160.0030.00519.05
8.1.150.0000.00718.78
8.1.140.0040.00417.62
8.1.130.0000.00718.90
8.1.120.0030.00317.64
8.1.110.0000.00817.55
8.1.100.0000.00717.60
8.1.90.0000.00817.58
8.1.80.0030.00617.57
8.1.70.0030.00617.62
8.1.60.0040.00417.71
8.1.50.0000.00817.55
8.1.40.0030.00617.55
8.1.30.0030.00517.83
8.1.20.0040.00417.77
8.1.10.0050.00317.64
8.1.00.0030.00517.62
8.0.300.0040.00418.77
8.0.290.0040.00416.88
8.0.280.0000.00718.45
8.0.270.0000.00717.34
8.0.260.0030.00318.90
8.0.250.0000.00717.16
8.0.240.0000.00717.18
8.0.230.0030.00317.18
8.0.220.0080.00017.13
8.0.210.0030.00317.10
8.0.200.0080.00017.14
8.0.190.0030.00517.12
8.0.180.0080.00317.07
8.0.170.0040.00417.15
8.0.160.0080.00017.18
8.0.150.0000.00717.14
8.0.140.0100.00017.04
8.0.130.0030.00313.45
8.0.120.0030.00517.05
8.0.110.0030.00517.08
8.0.100.0040.00416.89
8.0.90.0070.00016.97
8.0.80.0070.01417.11
8.0.70.0070.00017.13
8.0.60.0040.00417.11
8.0.50.0000.00916.95
8.0.30.0130.00417.17
8.0.20.0090.01217.40
8.0.10.0030.00517.16
8.0.00.0140.00917.08
7.4.330.0000.00715.55
7.4.320.0030.00516.61
7.4.300.0060.00016.79
7.4.290.0030.00516.54
7.4.280.0000.00916.73
7.4.270.0000.00716.76
7.4.260.0030.00516.56
7.4.250.0000.00816.63
7.4.240.0040.00416.66
7.4.230.0000.00716.56
7.4.220.0130.00716.76
7.4.210.0060.00816.77
7.4.200.0000.00716.63
7.4.160.0060.00916.75
7.4.150.0100.00717.40
7.4.140.0110.00717.86
7.4.130.0060.01616.61
7.4.120.0090.00916.69
7.4.110.0100.00616.61
7.4.100.0100.00716.75
7.4.90.0100.00716.61
7.4.80.0130.00419.39
7.4.70.0130.02116.87
7.4.60.0090.00916.80
7.4.50.0070.01116.52
7.4.40.0210.00316.82
7.4.30.0100.01016.59
7.4.00.0070.01015.00
7.3.330.0000.00513.48
7.3.320.0030.00313.48
7.3.310.0000.00716.54
7.3.300.0070.00016.53
7.3.290.0030.00316.37
7.3.280.0100.00716.48
7.3.270.0110.00617.40
7.3.260.0110.00916.55
7.3.250.0140.00616.64
7.3.240.0080.01316.69
7.3.230.0060.01016.72
7.3.210.0130.00416.73
7.3.200.0030.01516.74
7.3.190.0110.00716.58
7.3.180.0150.00616.66
7.3.170.0090.00616.73
7.3.160.0070.01116.45
7.2.330.0080.01116.91
7.2.320.0100.01316.87
7.2.310.0120.00616.69
7.2.300.0110.00716.80
7.2.290.0140.00716.82
7.2.60.0380.00917.02
7.2.50.0130.00317.13
7.1.200.0120.00015.78
7.1.110.0150.01016.11
7.1.100.0100.00816.08
7.1.90.0100.01016.01
7.1.80.0120.01216.25
7.1.70.0360.00315.54
7.1.60.0470.01633.48
7.1.50.0630.01333.22
7.1.40.0580.00932.61
7.1.30.0510.01532.53
7.1.20.0510.01332.88
7.1.10.0380.01314.91
7.1.00.0070.01014.86
7.0.250.0050.01115.84
7.0.240.0810.01915.97
7.0.230.0280.01315.78
7.0.220.0620.01315.87
7.0.210.0070.00715.09
7.0.200.0470.01415.08
7.0.190.0270.01214.95
7.0.180.0350.01214.52
7.0.170.0340.01714.57
7.0.160.0060.01214.52
7.0.150.0370.01314.57
7.0.140.0360.01414.53
7.0.130.0350.01614.88
7.0.120.0560.00714.71
7.0.110.0430.00714.69
7.0.100.0350.00414.62
7.0.90.0250.00914.68
7.0.80.0250.00914.88
7.0.70.0380.00614.35
7.0.60.0250.00914.23
7.0.50.0030.01414.52
7.0.40.0210.01014.79
7.0.30.0230.00714.67
7.0.20.0890.01014.45
7.0.10.0260.01114.91
7.0.00.0260.00914.91

preferences:
56.52 ms | 400 KiB | 5 Q