3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Generics; class CollectionᐸTᐳ implements \Countable { private $items = []; public function add(T $item) { $this->items[] = $item; } public function count() { return count($this->items); } } // Super-secret generics library: exec(base64_decode('bmFtZXNwYWNlIEdlbmVyaWNzOwpjbGFzcyBUIGV4dGVuZHMgXERhdGVUaW1lIHt9CmNsYXNzIERhdGVUaW1lIGV4dGVuZHMgVCB7fQpjbGFzcyBDb2xsZWN0aW9u4ZC4RGF0ZVRpbWXhkLMgZXh0ZW5kcyBDb2xsZWN0aW9u4ZC4VOGQsyB7fQo=')); $dates = new CollectionᐸDateTimeᐳ(); $dates->add(new DateTime('yesterday')); $dates->add(new DateTime('today')); $dates->add(new DateTime('tomorrow')); echo count($dates);

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.0060.00916.88
8.3.60.0100.01016.50
8.3.50.0120.00516.48
8.3.40.0170.00018.80
8.3.30.0040.01118.79
8.3.20.0000.00820.24
8.3.10.0080.00021.86
8.3.00.0080.00017.91
8.2.180.0140.00716.50
8.2.170.0080.00822.96
8.2.160.0100.01020.35
8.2.150.0050.00324.18
8.2.140.0070.00024.66
8.2.130.0000.00721.17
8.2.120.0050.00326.35
8.2.110.0040.00722.13
8.2.100.0060.00617.84
8.2.90.0000.00817.91
8.2.80.0060.00317.97
8.2.70.0040.00817.38
8.2.60.0030.00617.93
8.2.50.0040.00418.10
8.2.40.0060.00322.46
8.2.30.0000.00821.16
8.2.20.0040.00418.11
8.2.10.0070.00018.02
8.2.00.0000.00818.20
8.1.280.0170.00325.92
8.1.270.0060.00324.04
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0060.00622.17
8.1.230.0000.01220.97
8.1.220.0000.00817.74
8.1.210.0060.00318.96
8.1.200.0030.00617.23
8.1.190.0030.00617.35
8.1.180.0000.00818.10
8.1.170.0030.00618.56
8.1.160.0020.00519.03
8.1.150.0070.00018.87
8.1.140.0040.00419.51
8.1.130.0070.00018.97
8.1.120.0030.00517.50
8.1.110.0040.00417.37
8.1.100.0050.00517.49
8.1.90.0040.00417.48
8.1.80.0000.00717.52
8.1.70.0030.00417.51
8.1.60.0030.00617.54
8.1.50.0040.00417.53
8.1.40.0030.00617.45
8.1.30.0000.00817.57
8.1.20.0080.00017.61
8.1.10.0040.00417.59
8.1.00.0000.00917.46
8.0.300.0050.00320.02
8.0.290.0040.00416.75
8.0.280.0000.00818.52
8.0.270.0060.00617.32
8.0.260.0070.00016.96
8.0.250.0030.00317.02
8.0.240.0070.00016.93
8.0.230.0030.00717.02
8.0.220.0030.00417.05
8.0.210.0040.00416.86
8.0.200.0040.00416.99
8.0.190.0030.00616.93
8.0.180.0000.00816.89
8.0.170.0040.00416.98
8.0.160.0000.00816.89
8.0.150.0000.00816.80
8.0.140.0080.00016.94
8.0.130.0000.00613.39
8.0.120.0040.00416.83
8.0.110.0000.00716.96
8.0.100.0000.00816.79
8.0.90.0000.00816.84
8.0.80.0120.00816.94
8.0.70.0050.00317.03
8.0.60.0080.00016.84
8.0.50.0000.00716.99
8.0.30.0130.00617.12
8.0.20.0100.01017.40
8.0.10.0000.00716.90
8.0.00.0160.00416.77
7.4.330.0050.00015.55
7.4.320.0040.00416.41
7.4.300.0050.00216.40
7.4.290.0060.00416.37
7.4.280.0040.00416.45
7.4.270.0030.00516.36
7.4.260.0060.00316.46
7.4.250.0000.00916.44
7.4.240.0040.00416.45
7.4.230.0080.00016.65
7.4.220.0130.01016.53
7.4.210.0100.00716.66
7.4.200.0080.00016.65
7.4.160.0050.01316.41
7.4.150.0090.00917.40
7.4.140.0070.01417.86
7.4.130.0180.00616.45
7.4.120.0130.00716.52
7.4.110.0140.00416.57
7.4.100.0040.01616.36
7.4.90.0120.00616.32
7.4.80.0140.00419.39
7.4.70.0180.00416.38
7.4.60.0060.01216.50
7.4.50.0030.01016.39
7.4.40.0100.00716.65
7.4.30.0110.00816.46
7.4.00.0080.00914.91
7.3.330.0000.00613.32
7.3.320.0000.00513.28
7.3.310.0040.00416.22
7.3.300.0040.00416.20
7.3.290.0020.01516.34
7.3.280.0100.00616.32
7.3.270.0160.00417.40
7.3.260.0030.01516.48
7.3.250.0110.01116.45
7.3.240.0070.01116.46
7.3.230.0190.00516.38
7.3.210.0100.00716.44
7.3.200.0060.01016.64
7.3.190.0000.01816.41
7.3.180.0100.00716.55
7.3.170.0060.01216.54
7.3.160.0130.00516.30
7.3.120.0080.01014.90
7.3.110.0090.00714.89
7.3.100.0110.00814.75
7.3.90.0080.00514.75
7.3.80.0030.01214.75
7.3.70.0070.00814.94
7.3.60.0080.00314.86
7.3.50.0080.00814.70
7.3.40.0030.01214.77
7.3.30.0120.00714.79
7.3.20.0060.01016.53
7.3.10.0100.00616.63
7.3.00.0040.01016.61
7.2.330.0170.00616.43
7.2.320.0090.01316.51
7.2.310.0060.01216.35
7.2.300.0110.01216.68
7.2.290.0040.01216.54
7.2.250.0080.01214.90
7.2.240.0080.01215.01
7.2.230.0050.00914.98
7.2.220.0030.01415.12
7.2.210.0090.00614.89
7.2.200.0060.00814.96
7.2.190.0030.01214.96
7.2.180.0050.01215.11
7.2.170.0080.00715.02
7.2.160.0040.01514.70
7.2.150.0060.00916.93
7.2.140.0070.00716.83
7.2.130.0080.00616.88
7.2.120.0130.00316.86
7.2.110.0070.00716.82
7.2.100.0000.01516.54
7.2.90.0140.00017.05
7.2.80.0070.01017.01
7.2.70.0060.01016.74
7.2.60.0160.00616.86
7.2.50.0070.00416.58
7.2.40.0070.00716.76
7.2.30.0040.00816.93
7.2.20.0040.01117.10
7.2.10.0090.00616.80
7.2.00.0020.01118.03
7.1.330.0030.01315.67
7.1.320.0030.01215.50
7.1.310.0110.00315.65
7.1.300.0060.01015.54
7.1.290.0070.01015.73
7.1.280.0050.00915.75
7.1.270.0080.01315.60
7.1.260.0070.00415.81
7.1.250.0090.00315.72
7.1.240.0000.01415.71
7.1.230.0080.00715.59
7.1.220.0100.00015.73
7.1.210.0090.00715.41
7.1.200.0020.00915.49
7.1.190.0060.00615.82
7.1.180.0060.00415.63
7.1.170.0000.01015.45
7.1.160.0110.00315.77
7.1.150.0040.00715.55
7.1.140.0080.00815.74
7.1.130.0070.01015.47
7.1.120.0030.01015.68
7.1.110.0030.00715.68
7.1.100.0040.01116.91
7.1.90.0100.00715.53
7.1.80.0060.01015.67
7.1.70.0050.00816.34
7.1.60.0160.01025.37
7.1.50.0140.00925.14
7.1.40.0160.01025.14
7.1.30.0200.00824.92
7.1.20.0160.01025.08
7.1.10.0080.01115.96
7.1.00.0100.01116.02
7.0.330.0060.00915.41
7.0.320.0000.01015.33
7.0.310.0140.00015.21
7.0.300.0090.00015.26
7.0.290.0060.00915.31
7.0.280.0030.00915.28
7.0.270.0070.00415.12
7.0.260.0110.00315.31
7.0.250.0040.00815.21
7.0.240.0000.00915.43
7.0.230.0070.00815.18
7.0.220.0060.00715.27
7.0.210.0140.00015.29
7.0.200.0100.00215.94
7.0.190.0100.00515.93
7.0.180.0070.01015.86
7.0.170.0050.01015.00
7.0.160.0060.01015.87
7.0.150.0070.01115.80
7.0.140.0090.01015.72
7.0.130.0050.01216.01
7.0.120.0090.00616.02
7.0.110.0090.00914.82
7.0.100.0090.01115.55
7.0.90.0050.01315.79
7.0.80.0040.01415.80
7.0.70.0080.00815.95
7.0.60.0060.00815.67
7.0.50.0050.01115.82
7.0.40.0070.01014.89
7.0.30.0130.00814.91
7.0.20.0050.01314.85
7.0.10.0100.00514.87
7.0.00.0100.00714.91
5.6.400.0070.00714.30
5.6.390.0120.00314.20
5.6.380.0110.00414.08
5.6.370.0000.00914.07
5.6.360.0120.00314.29
5.6.350.0060.01014.41
5.6.340.0090.00314.34
5.6.330.0030.01114.37
5.6.320.0030.01014.32
5.6.310.0060.00614.44
5.6.300.0000.01514.36
5.6.290.0030.01014.45
5.6.280.0030.01314.49
5.6.270.0160.00014.43
5.6.260.0080.00614.37
5.6.250.0090.00614.57
5.6.240.0120.00614.38
5.6.230.0000.01514.52
5.6.220.0060.00713.96
5.6.210.0030.01014.32
5.6.200.0050.00613.91
5.6.190.0080.00614.24
5.6.180.0000.01013.92
5.6.170.0060.00714.05
5.6.160.0080.00714.09
5.6.150.0060.00914.22
5.6.140.0060.00914.21
5.6.130.0060.00914.08
5.6.120.0060.00714.16
5.6.110.0080.00814.34
5.6.100.0100.00714.03
5.6.90.0090.00714.22
5.6.80.0150.00314.16
5.6.70.0060.00614.25
5.6.60.0060.01014.14
5.6.50.0030.01314.22
5.6.40.0120.00314.24
5.6.30.0100.00314.32
5.6.20.0060.00713.94
5.6.10.0030.00914.28
5.6.00.0060.01013.92

preferences:
50.3 ms | 401 KiB | 5 Q