3v4l.org

run code in 300+ PHP versions simultaneously
<?php class CollectionᐸTᐳ implements \Countable { private $items = []; public function add(T $item) { $this->items[] = $item; } public function count() { return count($this->items); } } // Magic string to enable generics: eval(base64_decode('Y2xhc3MgVCBleHRlbmRzIFxEYXRlVGltZSB7fSBjbGFzcyBEYXRl0KJpbWUgZXh0ZW5kcyBUIHt9IGNsYXNzIENvbGxlY3Rpb27hkLhEYXRlVGltZeGQsyBleHRlbmRzIENvbGxlY3Rpb27hkLhU4ZCzIHt9')); $dates = new CollectionᐸDateTimeᐳ(); $dates->add(new DateТime('yesterday')); $dates->add(new DateТime('today')); $dates->add(new DateТime('tomorrow')); $dates->add('tesst'); echo "There are " . count($dates) . " DateTimes in the Collection\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.40.0110.00419.02
8.3.30.0030.01219.09
8.3.20.0040.00420.33
8.3.10.0050.00323.71
8.3.00.0060.00318.09
8.2.170.0070.00722.96
8.2.160.0140.00020.42
8.2.150.0000.00824.18
8.2.140.0050.00324.66
8.2.130.0040.00420.94
8.2.120.0050.00326.35
8.2.110.0090.00021.03
8.2.100.0090.00318.28
8.2.90.0040.00419.34
8.2.80.0040.00417.97
8.2.70.0060.00317.88
8.2.60.0040.00417.93
8.2.50.0000.00818.10
8.2.40.0060.00320.67
8.2.30.0000.00821.08
8.2.20.0050.00218.11
8.2.10.0040.00418.27
8.2.00.0040.00418.25
8.1.270.0040.00423.77
8.1.260.0030.00526.35
8.1.250.0030.00628.09
8.1.240.0100.00023.84
8.1.230.0030.00919.04
8.1.220.0040.00417.89
8.1.210.0030.00518.77
8.1.200.0050.00517.63
8.1.190.0000.00817.48
8.1.180.0000.00918.10
8.1.170.0050.00518.65
8.1.160.0040.00419.11
8.1.150.0000.00720.74
8.1.140.0040.00419.54
8.1.130.0030.00318.91
8.1.120.0000.00717.68
8.1.110.0050.00517.70
8.1.100.0040.00417.59
8.1.90.0000.00917.58
8.1.80.0000.00717.55
8.1.70.0000.00717.61
8.1.60.0000.01017.62
8.1.50.0000.00817.72
8.1.40.0000.00817.59
8.1.30.0040.00417.68
8.1.20.0000.00917.64
8.1.10.0000.00817.76
8.1.00.0030.00617.61
8.0.300.0040.00418.77
8.0.290.0050.00216.88
8.0.280.0070.00018.44
8.0.270.0030.00317.29
8.0.260.0030.00317.09
8.0.250.0070.00017.25
8.0.240.0070.00317.21
8.0.230.0070.00017.24
8.0.220.0030.00317.18
8.0.210.0000.00717.14
8.0.200.0030.00317.11
8.0.190.0000.00817.20
8.0.180.0040.00417.23
8.0.170.0030.00517.09
8.0.160.0040.00417.16
8.0.150.0030.00317.11
8.0.140.0070.00016.96
8.0.130.0030.00313.48
8.0.120.0030.00517.02
8.0.110.0020.00517.20
8.0.100.0080.00017.12
8.0.90.0070.00016.96
8.0.80.0060.01017.15
8.0.70.0000.00817.15
8.0.60.0040.00417.04
8.0.50.0070.00017.11
8.0.30.0140.00817.30
8.0.20.0070.01217.40
8.0.10.0050.00217.31
8.0.00.0100.00717.22
7.4.330.0050.00015.55
7.4.320.0060.00016.65
7.4.300.0060.00016.71
7.4.290.0050.00516.64
7.4.280.0060.00316.81
7.4.270.0040.00316.65
7.4.260.0000.00513.25
7.4.250.0030.00516.62
7.4.240.0000.00716.73
7.4.230.0050.00216.79
7.4.220.0130.00716.61
7.4.210.0070.00716.70
7.4.200.0000.00716.50
7.4.160.0110.00716.55
7.4.150.0130.00417.40
7.4.140.0110.00917.86
7.4.130.0080.01116.83
7.4.120.0130.01116.83
7.4.110.0060.01216.75
7.4.100.0170.00716.68
7.4.90.0090.00916.66
7.4.80.0110.00619.39
7.4.70.0090.00916.61
7.4.60.0120.00316.73
7.4.50.0060.00316.58
7.4.40.0070.01016.46
7.4.30.0100.00716.70
7.4.00.0030.01414.92
7.3.330.0060.00013.36
7.3.320.0060.00013.53
7.3.310.0000.00716.44
7.3.300.0070.00016.50
7.3.290.0100.00416.51
7.3.280.0060.01116.53
7.3.270.0130.00317.40
7.3.260.0100.01016.70
7.3.250.0110.01016.70
7.3.240.0090.00916.67
7.3.230.0120.00616.71
7.3.210.0090.00616.72
7.3.200.0130.00316.59
7.3.190.0160.00016.73
7.3.180.0030.01316.59
7.3.170.0040.01816.63
7.3.160.0160.00416.47
7.3.10.0090.00616.62
7.3.00.0040.01216.57
7.2.330.0080.00817.02
7.2.320.0100.01316.94
7.2.310.0150.00316.98
7.2.300.0130.01016.94
7.2.290.0100.00717.00
7.2.130.0070.00717.22
7.2.120.0030.01317.09
7.2.110.0060.00617.18
7.2.100.0070.00717.23
7.2.90.0070.01016.98
7.2.80.0070.00417.09
7.2.70.0000.01617.25
7.2.60.0090.00717.20
7.2.50.0040.01216.92
7.2.40.0070.00717.27
7.2.30.0060.00617.25
7.2.20.0060.00317.22
7.2.10.0030.00717.09
7.2.00.0080.00818.05
7.1.250.0040.01115.63
7.1.240.0090.00315.66
7.1.230.0070.00715.70
7.1.220.0060.01015.84
7.1.210.0110.00415.81
7.1.200.0090.00316.01
7.1.190.0090.00015.82
7.1.180.0070.00416.05
7.1.170.0040.01115.61
7.1.160.0110.00315.66
7.1.150.0090.00315.58
7.1.140.0100.00615.99
7.1.130.0060.00915.66
7.1.120.0070.01015.97
7.1.110.0030.01016.05
7.1.100.0070.00717.07
7.1.90.0070.00716.11
7.1.80.0030.01015.82
7.1.70.0080.00816.63
7.1.60.0170.01225.57
7.1.50.0170.01225.34
7.1.40.0200.01025.10
7.1.30.0180.00825.08
7.1.20.0190.00525.29
7.1.10.0090.00416.34
7.1.00.0070.01116.42
7.0.330.0000.00915.36
7.0.320.0060.00615.53
7.0.310.0040.01115.51
7.0.300.0060.00915.47
7.0.290.0040.00415.70
7.0.280.0030.00615.58
7.0.270.0060.00615.30
7.0.260.0030.00615.45
7.0.250.0090.00315.45
7.0.240.0040.00715.54
7.0.230.0060.00615.63
7.0.220.0070.00715.66
7.0.210.0040.00415.38
7.0.200.0040.01016.16
7.0.190.0070.01016.13
7.0.180.0050.01015.76
7.0.170.0070.00815.93
7.0.160.0080.00515.97
7.0.150.0040.00915.93
7.0.140.0060.01216.01
7.0.130.0090.00915.83
7.0.120.0110.00816.03
7.0.110.0070.00816.00
7.0.100.0050.01015.87
7.0.90.0080.01016.00
7.0.80.0080.00816.09
7.0.70.0120.00415.91
7.0.60.0100.00315.99
7.0.50.0050.01215.95
7.0.40.0090.00715.04
7.0.30.0060.00815.04
7.0.20.0080.00714.97
7.0.10.0070.00815.04
7.0.00.0060.00915.18
5.6.380.0040.01114.65

preferences:
35.77 ms | 400 KiB | 5 Q