3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types = 1); class HelloWorld { /** @var array<string, string> */ private $items; public function doFoo(string $input) { $this->items[$input] = $input; /*foreach ($this->items as $key => $value) { $this->requireString($key); }*/ } public function requireString(string $s) { } } $h = new HelloWorld(); $h->doFoo('1'); // bang

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.0150.00718.51
8.3.50.0090.00618.03
8.3.40.0090.00618.63
8.3.30.0160.00318.67
8.3.20.0000.00818.80
8.3.10.0040.00423.71
8.3.00.0040.00422.51
8.2.180.0070.00718.16
8.2.170.0140.00722.96
8.2.160.0110.00421.10
8.2.150.0070.00024.18
8.2.140.0080.00024.66
8.2.130.0070.00022.27
8.2.120.0080.00026.35
8.2.110.0030.00622.15
8.2.100.0030.00819.57
8.2.90.0040.00417.63
8.2.80.0060.00318.78
8.2.70.0080.00317.93
8.2.60.0040.00418.22
8.2.50.0080.00018.10
8.2.40.0000.00821.05
8.2.30.0030.00320.63
8.2.20.0030.00617.95
8.2.10.0040.00417.97
8.2.00.0030.00519.43
8.1.280.0040.01125.92
8.1.270.0040.00423.97
8.1.260.0000.00826.35
8.1.250.0030.00628.09
8.1.240.0060.00319.05
8.1.230.0070.00417.89
8.1.220.0000.00717.76
8.1.210.0000.00818.77
8.1.200.0060.00317.35
8.1.190.0040.00417.53
8.1.180.0060.00318.10
8.1.170.0090.00018.59
8.1.160.0000.00818.82
8.1.150.0070.00018.88
8.1.140.0000.00719.01
8.1.130.0000.00818.95
8.1.120.0000.00717.30
8.1.110.0050.00317.35
8.1.100.0000.00717.43
8.1.90.0040.00417.41
8.1.80.0040.00417.38
8.1.70.0050.00217.44
8.1.60.0050.00317.54
8.1.50.0040.00417.41
8.1.40.0000.00817.37
8.1.30.0030.00717.66
8.1.20.0040.00417.54
8.1.10.0040.00417.41
8.1.00.0080.00017.44
8.0.300.0060.00318.77
8.0.290.0030.00516.63
8.0.280.0000.00718.29
8.0.270.0000.00717.20
8.0.260.0000.00719.05
8.0.250.0030.00316.96
8.0.240.0060.00316.86
8.0.230.0040.00416.88
8.0.220.0000.00716.72
8.0.210.0000.00716.81
8.0.200.0060.00016.75
8.0.190.0000.00716.87
8.0.180.0040.00416.93
8.0.170.0000.00916.75
8.0.160.0040.00416.90
8.0.150.0040.00416.63
8.0.140.0050.00316.68
8.0.130.0030.00313.24
8.0.120.0030.00516.67
8.0.110.0050.00316.77
8.0.100.0040.00416.63
8.0.90.0070.00016.61
8.0.80.0110.00816.76
8.0.70.0040.00416.81
8.0.60.0070.00016.71
8.0.50.0040.00416.62
8.0.30.0130.00717.07
8.0.20.0090.01017.40
8.0.10.0040.00416.76
8.0.00.0080.01116.70
7.4.330.0000.00615.55
7.4.320.0060.00016.35
7.4.300.0040.00416.59
7.4.290.0030.00316.60
7.4.280.0040.00416.58
7.4.270.0070.00016.52
7.4.260.0070.00016.42
7.4.250.0030.00316.55
7.4.240.0030.00616.61
7.4.230.0070.00016.55
7.4.220.0060.00316.57
7.4.210.0050.01316.60
7.4.200.0050.00216.53
7.4.160.0090.00616.38
7.4.140.0100.00817.86
7.4.130.0030.01316.52
7.4.120.0090.01016.44
7.4.110.0130.00616.59
7.4.100.0110.00616.45
7.4.90.0110.00616.55
7.4.80.0030.01319.39
7.4.70.0120.00816.50
7.4.60.0030.01316.30
7.4.50.0070.01116.14
7.4.40.0070.01416.41
7.4.00.0050.01314.98
7.3.330.0000.00613.07
7.3.320.0040.00413.32
7.3.310.0070.00016.36
7.3.300.0000.00716.35
7.3.290.0030.00316.31
7.3.280.0050.01216.26
7.3.260.0140.00916.49
7.3.240.0100.00916.44
7.3.230.0180.00416.45
7.3.210.0100.00716.61
7.3.200.0070.01316.27
7.3.190.0070.01316.33
7.3.180.0040.01216.38
7.3.170.0090.00916.33
7.3.160.0030.01316.45
7.3.120.0090.00314.98
7.3.110.0030.01414.82
7.3.100.0000.01814.82
7.3.90.0060.01214.70
7.3.80.0100.00314.88
7.3.70.0000.01114.88
7.3.60.0040.01214.63
7.3.50.0030.00714.64
7.3.40.0090.00314.79
7.3.30.0030.00714.93
7.3.20.0100.00016.36
7.3.10.0150.00016.61
7.3.00.0040.01116.43
7.2.330.0070.01116.69
7.2.320.0060.01216.21
7.2.310.0030.01616.67
7.2.300.0100.00716.72
7.2.290.0120.00416.62
7.2.250.0000.01814.89
7.2.240.0110.00714.87
7.2.230.0080.00815.21
7.2.220.0100.00715.04
7.2.210.0070.01014.89
7.2.200.0040.01415.05
7.2.190.0080.00814.58
7.2.180.0070.01014.76
7.2.170.0100.00714.92
7.2.110.0050.00816.66
7.2.80.0260.00314.67
7.2.70.0180.01115.15
7.2.60.0080.00814.86
7.2.50.0370.00314.95
7.2.40.0280.00915.03
7.2.30.0390.00715.18
7.2.20.0110.00615.06
7.2.10.0770.00715.03
7.2.00.0320.00715.11
7.1.330.0060.00815.78
7.1.320.0070.01115.84
7.1.310.0030.01015.82
7.1.300.0040.00415.51
7.1.290.0070.00715.74
7.1.280.0100.00015.56
7.1.270.0030.01015.80
7.1.260.0030.01015.55
7.1.200.0490.01013.54
7.1.190.0030.00714.03
7.1.180.0110.00413.88
7.1.170.0140.00713.90
7.1.160.0200.01013.86
7.1.150.0440.00913.49
7.1.140.0130.00013.98
7.1.130.0380.00413.80
7.1.120.0480.00313.68
7.1.110.0410.00613.83
7.1.100.0310.00613.93
7.1.90.0280.00614.05
7.1.80.0390.00313.66
7.1.70.0380.00613.83
7.1.60.0620.00932.08
7.1.50.0570.00631.93
7.1.40.0500.00631.59
7.1.30.0290.01031.88
7.1.20.0410.01732.00
7.1.10.0510.01013.89
7.1.00.0600.00713.89

preferences:
58.25 ms | 401 KiB | 5 Q