3v4l.org

run code in 300+ PHP versions simultaneously
<?php function mod(&$item){ $item["position"] = preg_replace("/[^0-9]+/","",$item["position"]); $item["count"] = 2*$item["count"]; } $items = [ ["position" => "1", "count" => 4], ["position" => "2", "count" => 3], ]; echo "before: \n"; foreach($items as $item){ var_dump($item) . "\n"; } echo "modifying items...\n"; foreach($items as &$itemRef){ mod($itemRef); } echo "after: \n"; foreach($items as $item){ echo "A"; var_dump($item) . "\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.4.140.0120.01017.85
8.4.130.0140.00718.05
8.4.120.0150.00620.71
8.4.110.0050.00420.82
8.4.100.0080.00118.18
8.4.90.0130.00720.49
8.4.80.0110.00920.66
8.4.70.0060.00317.96
8.4.60.0080.01318.75
8.4.50.0110.00818.65
8.4.40.0100.01020.03
8.4.30.0120.00318.52
8.4.20.0070.01420.59
8.4.10.0130.00317.97
8.3.270.0080.01216.82
8.3.260.0140.00616.41
8.3.250.0120.00718.95
8.3.240.0120.00816.73
8.3.230.0130.00616.64
8.3.220.0080.01120.68
8.3.210.0110.00716.82
8.3.200.0060.00316.69
8.3.190.0100.00716.62
8.3.180.0150.00516.86
8.3.170.0130.00618.86
8.3.160.0150.00316.98
8.3.150.0190.00018.98
8.3.140.0000.01018.81
8.3.130.0040.00416.69
8.3.120.0060.01318.98
8.3.110.0060.00320.94
8.3.100.0030.00524.06
8.3.90.0000.00826.77
8.3.80.0060.00316.63
8.3.70.0140.00716.75
8.3.60.0120.00618.27
8.3.50.0120.00518.42
8.3.40.0120.00618.96
8.3.30.0060.00919.10
8.3.20.0040.00421.73
8.3.10.0070.01123.50
8.3.00.0000.00820.96
8.2.290.0020.00617.39
8.2.280.0050.00420.43
8.2.270.0120.00816.80
8.2.260.0030.00516.68
8.2.250.0070.00316.94
8.2.240.0070.00416.94
8.2.230.0100.00322.58
8.2.220.0000.00837.54
8.2.210.0030.00626.77
8.2.200.0030.00616.63
8.2.190.0070.01116.63
8.2.180.0060.00925.92
8.2.170.0110.00719.22
8.2.160.0100.00321.18
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0040.00426.16
8.2.120.0060.00319.61
8.2.110.0030.00622.41
8.2.100.0080.00418.03
8.2.90.0040.00417.88
8.2.80.0000.01019.02
8.2.70.0000.00817.88
8.2.60.0000.01017.80
8.2.50.0050.00318.07
8.2.40.0000.00818.29
8.2.30.0000.00818.09
8.2.20.0040.00418.06
8.2.10.0040.00419.33
8.2.00.0080.00019.26
8.1.330.0050.00416.29
8.1.320.0050.00516.04
8.1.310.0040.00416.66
8.1.300.0070.00316.26
8.1.290.0030.00618.88
8.1.280.0100.00625.92
8.1.270.0090.00020.67
8.1.260.0040.00426.35
8.1.250.0070.00028.09
8.1.240.0090.00020.49
8.1.230.0060.00617.89
8.1.220.0000.00917.78
8.1.210.0040.00418.77
8.1.200.0060.00317.60
8.1.190.0030.00619.00
8.1.180.0040.00418.10
8.1.170.0000.01318.42
8.1.160.0000.00718.77
8.1.150.0050.00218.95
8.1.140.0030.00322.11
8.1.130.0030.00320.12
8.1.120.0000.00817.54
8.1.110.0000.01017.60
8.1.100.0040.00417.65
8.1.90.0000.00717.52
8.1.80.0000.00717.61
8.1.70.0000.00817.49
8.1.60.0000.01117.63
8.1.50.0000.00817.65
8.1.40.0030.00517.63
8.1.30.0000.00817.84
8.1.20.0070.00017.73
8.1.10.0040.00417.72
8.1.00.0040.00417.50
8.0.300.0000.00718.77
8.0.290.0080.00016.88
8.0.280.0030.00318.36
8.0.270.0050.00217.02
8.0.260.0030.00318.44
8.0.250.0070.00017.09
8.0.240.0040.00417.00
8.0.230.0030.00317.05
8.0.220.0030.00317.01
8.0.210.0000.00816.91
8.0.200.0030.00317.04
8.0.190.0070.00017.05
8.0.180.0070.00317.08
8.0.170.0030.00517.09
8.0.160.0070.00017.00
8.0.150.0040.00416.96
8.0.140.0000.00816.93
8.0.130.0000.00813.48
8.0.120.0040.00417.00
8.0.110.0040.00417.05
8.0.100.0030.00316.93
8.0.90.0000.00717.09
8.0.80.0140.00516.98
8.0.70.0000.00716.87
8.0.60.0070.00017.07
8.0.50.0040.00416.89
8.0.30.0120.00617.06
8.0.20.0130.00817.43
8.0.10.0050.00216.95
8.0.00.0070.01116.93
7.4.330.0050.00015.55
7.4.320.0000.00716.71
7.4.300.0030.00516.79
7.4.290.0070.00016.79
7.4.280.0040.00416.69
7.4.270.0030.00316.62
7.4.260.0040.00416.63
7.4.250.0030.00316.81
7.4.240.0050.00216.78
7.4.230.0040.00416.86
7.4.220.0000.00816.59
7.4.210.0090.00716.73
7.4.200.0050.00216.79
7.4.160.0080.00916.67
7.4.140.0110.01117.86
7.4.130.0130.01016.68
7.4.120.0110.01116.70
7.4.110.0100.01016.91
7.4.100.0200.00316.56
7.4.90.0040.01416.62
7.4.80.0070.01019.39
7.4.70.0060.01216.71
7.4.60.0160.00616.41
7.4.50.0000.00916.79
7.4.40.0050.01116.64
7.4.10.0110.00715.32
7.4.00.0070.00714.88
7.3.330.0000.00513.47
7.3.320.0060.00013.51
7.3.310.0030.00316.53
7.3.300.0040.00416.45
7.3.290.0070.00016.52
7.3.280.0120.00316.52
7.3.260.0080.01116.74
7.3.240.0100.01116.68
7.3.230.0110.00816.74
7.3.210.0070.01116.61
7.3.200.0050.01116.77
7.3.190.0190.00416.65
7.3.180.0030.01216.88
7.3.170.0150.00416.70
7.3.160.0070.01016.82
7.3.130.0090.00915.00
7.3.120.0070.01214.81
7.3.110.0050.01315.30
7.3.100.0090.00615.16
7.3.90.0060.00914.98
7.3.80.0060.00814.97
7.3.70.0060.01115.11
7.3.60.0080.00815.03
7.3.50.0010.01315.00
7.3.40.0070.00714.76
7.3.30.0050.00614.91
7.3.20.0030.01216.79
7.3.10.0060.00816.95
7.3.00.0240.00715.87
7.2.330.0160.01016.90
7.2.320.0110.01416.88
7.2.310.0060.01516.64
7.2.300.0090.00916.77
7.2.290.0080.00816.68
7.2.260.0120.00915.30
7.2.250.0080.01215.26
7.2.240.0070.01115.15
7.2.230.0070.00715.28
7.2.220.0060.00815.15
7.2.210.0050.00715.26
7.2.200.0030.01115.27
7.2.190.0060.01015.39
7.2.180.0090.00715.11
7.2.170.0060.00615.21
7.2.160.0040.00915.30
7.2.150.0040.00816.93
7.2.140.0090.00617.14
7.2.130.0150.00516.15
7.2.120.0080.00916.24
7.2.110.0120.00716.29
7.2.100.0610.01116.14
7.2.90.0070.01116.19
7.2.80.0100.01316.34
7.2.70.0080.00816.22
7.2.60.3000.00516.10
7.2.50.0040.01116.16
7.2.40.0340.00916.13
7.2.30.0230.01216.21
7.2.20.0650.01516.21
7.2.10.0180.00216.22
7.2.00.0620.00716.38
7.1.330.0100.00615.84
7.1.320.0070.00815.96
7.1.310.0060.00416.16
7.1.300.0080.00915.94
7.1.290.0070.00815.84
7.1.280.0070.00716.02
7.1.270.0030.00716.02
7.1.260.0050.01016.02
7.1.250.0090.00915.21
7.1.240.0030.01215.96
7.1.230.0030.00915.88
7.1.220.0030.00616.13
7.1.210.0070.01116.06
7.1.200.0060.00915.88
7.1.190.0100.00416.17
7.1.180.0000.00915.79
7.1.170.0070.00716.05
7.1.160.0040.01115.90
7.1.150.0000.01316.05
7.1.140.0100.00716.10
7.1.130.0130.00015.97
7.1.120.0070.01015.95
7.1.110.0100.00715.86
7.1.100.0000.01715.98
7.1.90.0040.00415.62
7.1.80.0070.00416.10
7.1.70.0100.00316.09
7.1.60.0000.01516.00
7.1.50.0060.00915.96
7.1.40.0070.00716.22
7.1.30.0090.00615.80
7.1.20.0080.00815.74
7.1.10.0030.00615.86
7.1.00.0050.00816.00
7.0.330.0070.00715.34
7.0.320.0060.00315.59
7.0.310.0100.00315.63
7.0.300.0060.00815.73
7.0.290.0030.01415.72
7.0.280.0030.01315.25
7.0.270.0070.00715.34
7.0.260.0100.00615.30
7.0.250.0070.00715.36
7.0.240.0030.00715.71
7.0.230.0030.00615.39
7.0.220.0040.00815.30
7.0.210.0030.01215.70
7.0.200.0000.00915.79
7.0.190.0040.00815.57
7.0.180.0000.01115.82
7.0.170.0110.00415.51
7.0.160.0100.00315.30
7.0.150.0030.01015.36
7.0.140.0060.00615.67
7.0.130.0040.00415.63
7.0.120.0000.01415.73
7.0.110.0060.00815.35
7.0.100.0080.00815.75
7.0.90.0030.01015.59
7.0.80.0040.01115.64
7.0.70.0060.00615.67
7.0.60.0120.00315.41
7.0.50.0030.01015.38
7.0.40.0030.00613.85
7.0.30.0050.00513.64
7.0.20.0060.00713.79
7.0.10.0080.00413.76
7.0.00.0100.00313.61

preferences:
32.31 ms | 403 KiB | 5 Q