3v4l.org

run code in 300+ PHP versions simultaneously
<?php $ingredients = [ ['name' => 'TV','amount' => 3], ['name' => 'LAPTOP', 'amount' => 2], ['name' => 'HAREM', 'amount' => 2], ['name' => 'OIL', 'amount' => 1], ['name' => 'Windows', 'amount' => 1], ['name' => 'Something', 'amount' => 1] ]; $prices = [ 'TV' => 20, 'LAPTOP' => 20, 'HAREM' => 25, 'OIL' => 20, 'Windows' => 25, 'Something' => 35 ]; $name = array_column($ingredients,"name"); Foreach($prices as $item => $price){ $find = array_search($item, $name); If($find !== false) $res[$item] = $price * $ingredients[$find]['amount']; } Var_dump($res);

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.120.0050.00424.14
8.4.110.0080.00318.59
8.4.100.0120.00817.55
8.4.90.0130.00718.68
8.4.80.0050.00417.99
8.4.70.0110.01117.91
8.4.60.0170.00320.37
8.4.50.0100.01118.50
8.4.40.0100.01017.57
8.4.30.0000.00817.60
8.4.20.0170.00319.50
8.4.10.0070.00417.65
8.3.250.0130.00619.17
8.3.240.0080.00317.08
8.3.230.0120.00916.64
8.3.220.0130.00617.15
8.3.210.0120.00716.66
8.3.200.0060.00316.51
8.3.190.0140.00516.70
8.3.180.0070.00216.85
8.3.170.0000.00918.88
8.3.160.0130.00620.97
8.3.150.0040.01518.23
8.3.140.0060.00317.20
8.3.130.0100.01018.53
8.3.120.0070.00418.88
8.3.110.0120.00320.94
8.3.100.0040.00724.06
8.3.90.0100.00326.77
8.3.80.0070.00418.18
8.3.70.0070.01716.63
8.3.60.0070.01518.43
8.3.50.0090.00817.29
8.3.40.0060.00918.67
8.3.30.0090.00918.86
8.3.20.0050.00321.72
8.3.10.0040.00423.56
8.3.00.0080.00021.39
8.2.290.0120.00620.25
8.2.280.0100.01222.34
8.2.270.0130.00619.07
8.2.260.0120.00618.43
8.2.250.0040.00419.09
8.2.240.0060.00317.07
8.2.230.0030.00622.58
8.2.220.0040.00437.54
8.2.210.0060.00326.77
8.2.200.0000.00918.42
8.2.190.0070.00718.29
8.2.180.0160.00316.63
8.2.170.0160.00019.09
8.2.160.0080.00622.96
8.2.150.0000.00825.66
8.2.140.0000.00824.66
8.2.130.0040.00426.16
8.2.120.0050.00319.83
8.2.110.0060.00322.08
8.2.100.0040.00817.68
8.2.90.0040.00417.63
8.2.80.0050.00318.91
8.2.70.0000.01017.63
8.2.60.0080.00017.93
8.2.50.0000.00818.07
8.2.40.0070.00018.16
8.2.30.0050.00218.01
8.2.20.0040.00418.18
8.2.10.0000.00717.75
8.2.00.0070.00018.00
8.1.330.0100.01022.12
8.1.320.0050.00316.10
8.1.310.0070.00018.46
8.1.300.0030.00618.41
8.1.290.0070.00330.84
8.1.280.0100.01025.92
8.1.270.0080.00023.67
8.1.260.0090.00626.35
8.1.250.0120.00628.09
8.1.240.0120.00620.79
8.1.230.0060.00617.70
8.1.220.0030.00517.74
8.1.210.0090.00418.77
8.1.200.0040.00417.48
8.1.190.0030.00617.11
8.1.180.0040.00418.10
8.1.170.0000.00818.54
8.1.160.0040.00418.95
8.1.150.0040.00420.25
8.1.140.0040.00417.75
8.1.130.0040.00420.78
8.1.120.0050.00317.49
8.1.110.0000.00717.49
8.1.100.0050.00217.51
8.1.90.0060.00317.42
8.1.80.0000.00717.41
8.1.70.0000.01017.43
8.1.60.0030.00617.59
8.1.50.0080.00017.43
8.1.40.0000.00717.43
8.1.30.0030.00617.56
8.1.20.0030.00617.62
8.1.10.0050.00217.54
8.1.00.0050.00317.34
8.0.300.0040.00718.77
8.0.290.0070.00016.63
8.0.280.0000.00718.34
8.0.270.0070.00017.27
8.0.260.0060.00016.84
8.0.250.0000.00716.97
8.0.240.0000.00716.90
8.0.230.0070.00016.92
8.0.220.0080.00016.81
8.0.210.0030.00316.87
8.0.200.0000.00616.79
8.0.190.0000.00916.97
8.0.180.0030.00316.82
8.0.170.0080.00016.93
8.0.160.0040.00416.79
8.0.150.0040.00416.75
8.0.140.0000.00716.68
8.0.130.0070.00013.34
8.0.120.0040.00416.88
8.0.110.0040.00416.93
8.0.100.0040.00416.76
8.0.90.0000.00716.94
8.0.80.0090.00616.79
8.0.70.0070.00016.78
8.0.60.0070.00016.96
8.0.50.0050.00316.79
8.0.30.0100.00917.30
8.0.20.0150.00417.40
8.0.10.0040.00416.89
8.0.00.0100.01016.92
7.4.330.0030.00315.55
7.4.320.0080.00016.49
7.4.300.0070.00016.62
7.4.290.0030.00316.51
7.4.280.0000.00716.60
7.4.270.0000.00716.63
7.4.260.0000.00816.54
7.4.250.0040.00416.47
7.4.240.0000.00716.63
7.4.230.0000.00716.70
7.4.220.0080.00016.41
7.4.210.0060.01216.56
7.4.200.0030.00316.38
7.4.160.0110.00716.43
7.4.140.0100.00817.86
7.4.130.0150.00916.49
7.4.120.0110.00716.55
7.4.110.0120.00416.68
7.4.100.0140.00316.55
7.4.90.0110.00816.64
7.4.80.0160.00619.39
7.4.70.0200.00316.45
7.4.60.0030.01316.43
7.4.50.0110.00416.35
7.4.40.0110.01216.62
7.4.00.0040.01114.90
7.3.330.0030.00313.08
7.3.320.0000.00613.05
7.3.310.0030.00316.25
7.3.300.0030.00316.30
7.3.290.0070.00016.23
7.3.280.0120.00716.33
7.3.260.0120.00916.42
7.3.250.0080.01216.40
7.3.240.0070.01116.31
7.3.230.0090.00916.41
7.3.210.0170.00016.24
7.3.200.0080.00916.44
7.3.190.0040.01516.61
7.3.180.0060.00916.51
7.3.170.0030.01216.45
7.3.160.0150.00316.39
7.3.10.0030.01016.70
7.3.00.0060.00916.63
7.2.330.0130.00516.68
7.2.320.0180.00916.73
7.2.310.0100.00716.39
7.2.300.0100.01416.79
7.2.290.0000.02316.45
7.2.130.0090.00616.94
7.2.120.0060.00816.98
7.2.110.0090.00616.98
7.2.100.0090.00616.94
7.2.90.0110.00716.75
7.2.80.0070.01116.48
7.2.70.0080.00417.11
7.2.60.0090.00517.11
7.2.50.0030.00616.94
7.2.40.0120.00317.10
7.2.30.0140.00817.44
7.2.20.0100.01317.52
7.2.10.0070.01317.45
7.2.00.0110.01017.41
7.1.250.0070.00715.76
7.1.200.0030.00915.59
7.1.150.0140.01616.88
7.1.140.0160.00816.89
7.1.130.0170.01316.70
7.1.120.0210.01516.57
7.1.110.0180.01716.44
7.1.100.0140.01615.95
7.1.90.0130.01415.63
7.1.80.0150.01016.04
7.1.70.0100.01515.33
7.1.60.0430.01233.34
7.1.50.0320.01933.07
7.1.40.1180.01832.79
7.1.30.0410.01232.69
7.1.20.0380.01732.73
7.1.10.0200.01014.91
7.1.00.0130.01214.63

preferences:
28.62 ms | 403 KiB | 5 Q