3v4l.org

run code in 300+ PHP versions simultaneously
<?php $addresses = [ 'firstname' => 'first', 'middle' => 'middle', 'lastname' => 'last', 'address' => [ 'street' => 'streeeeeet', 'housenumber' => '10' ] ]; foreach ($addresses as $key => $record) { // Check type if ($key == 'address' && is_array($record)){ // Scan through inner loop foreach ($record as $value) { echo "$value\n"; } }else if (!is_array($record)){ // one, two, three // echo $key; } }

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.0150.00018.18
8.3.60.0040.01116.38
8.3.50.0120.00816.34
8.3.40.0120.00318.50
8.3.30.0130.00718.58
8.3.20.0050.00320.16
8.3.10.0030.00522.05
8.3.00.0080.00023.51
8.2.190.0180.00016.58
8.2.180.0140.00718.16
8.2.170.0070.00718.96
8.2.160.0130.00722.96
8.2.150.0000.00825.66
8.2.140.0040.00424.66
8.2.130.0060.00321.13
8.2.120.0080.00026.35
8.2.110.0060.00320.39
8.2.100.0110.00017.78
8.2.90.0040.00419.23
8.2.80.0050.00317.97
8.2.70.0000.00817.63
8.2.60.0060.00317.80
8.2.50.0000.00818.10
8.2.40.0050.00420.55
8.2.30.0000.00819.23
8.2.20.0070.00017.99
8.2.10.0040.00417.99
8.2.00.0070.00018.12
8.1.280.0040.01225.92
8.1.270.0060.00324.66
8.1.260.0050.00226.35
8.1.250.0040.00428.09
8.1.240.0030.00722.04
8.1.230.0110.00017.67
8.1.220.0100.00017.77
8.1.210.0080.00018.77
8.1.200.0050.00517.23
8.1.190.0030.00517.22
8.1.180.0040.00418.10
8.1.170.0050.00318.46
8.1.160.0000.00718.89
8.1.150.0050.00320.13
8.1.140.0050.00319.48
8.1.130.0030.00320.10
8.1.120.0000.00817.39
8.1.110.0000.00817.33
8.1.100.0000.00717.31
8.1.90.0040.00417.43
8.1.80.0040.00417.47
8.1.70.0000.00717.41
8.1.60.0030.00817.46
8.1.50.0020.00517.49
8.1.40.0070.00017.47
8.1.30.0050.00317.66
8.1.20.0060.00317.64
8.1.10.0000.00717.37
8.1.00.0040.00417.39
8.0.300.0000.00718.77
8.0.290.0080.00016.75
8.0.280.0030.00318.44
8.0.270.0050.00316.67
8.0.260.0000.00620.23
8.0.250.0030.00316.86
8.0.240.0040.00416.83
8.0.230.0030.00316.86
8.0.220.0030.00616.88
8.0.210.0000.00716.88
8.0.200.0040.00416.86
8.0.190.0070.00016.93
8.0.180.0000.00716.95
8.0.170.0070.00016.95
8.0.160.0080.00016.85
8.0.150.0000.00716.80
8.0.140.0040.00416.81
8.0.130.0000.00513.27
8.0.120.0050.00216.83
8.0.110.0050.00216.95
8.0.100.0080.00016.94
8.0.90.0000.00816.88
8.0.80.0000.01616.88
8.0.70.0050.00216.95
8.0.60.0050.00316.95
8.0.50.0030.00516.79
8.0.30.0070.01217.12
8.0.20.0110.00817.40
8.0.10.0000.00817.12
8.0.00.0100.00716.83
7.4.330.0030.00315.55
7.4.320.0060.00016.54
7.4.300.0030.00316.57
7.4.290.0070.00016.44
7.4.280.0040.00416.39
7.4.270.0050.00316.39
7.4.260.0000.00616.50
7.4.250.0030.00516.55
7.4.240.0070.00016.57
7.4.230.0070.00016.57
7.4.220.0060.01316.60
7.4.210.0100.00516.46
7.4.200.0000.00716.40
7.4.160.0100.01016.51
7.4.150.0070.01317.40
7.4.140.0120.00617.86
7.4.130.0180.00316.64
7.4.120.0120.00516.48
7.4.110.0160.00716.70
7.4.100.0150.00916.48
7.4.90.0110.01116.56
7.4.80.0120.00819.39
7.4.70.0070.01116.21
7.4.60.0060.01316.44
7.4.50.0070.01116.57
7.4.40.0120.00416.38
7.4.30.0130.00316.37
7.4.00.0050.01214.88
7.3.330.0000.00613.06
7.3.320.0030.00313.00
7.3.310.0070.00016.32
7.3.300.0000.00816.15
7.3.290.0060.00016.12
7.3.280.0090.00816.27
7.3.270.0080.00917.40
7.3.260.0150.00216.49
7.3.250.0130.00616.36
7.3.240.0080.00816.45
7.3.230.0070.01016.52
7.3.210.0160.00416.48
7.3.200.0180.00316.30
7.3.190.0090.00616.61
7.3.180.0110.01416.26
7.3.170.0030.01316.54
7.3.160.0090.00616.25
7.3.120.0100.00714.76
7.3.110.0000.01714.88
7.3.100.0080.00314.67
7.3.90.0130.00314.95
7.3.80.0110.00414.79
7.3.70.0060.00614.73
7.3.60.0070.00714.99
7.3.50.0060.01214.67
7.3.40.0100.00314.91
7.3.30.0060.00614.77
7.3.20.0040.00416.69
7.3.10.0030.00916.46
7.3.00.0040.00416.54
7.2.330.0070.01016.73
7.2.320.0040.02016.71
7.2.310.0120.00616.34
7.2.300.0120.00916.52
7.2.290.0000.01616.82
7.2.250.0100.01014.88
7.2.240.0060.01314.82
7.2.230.0090.00614.88
7.2.220.0090.00914.83
7.2.210.0030.00915.15
7.2.200.0060.00914.74
7.2.190.0000.01015.07
7.2.180.0030.01015.20
7.2.170.0030.00615.19
7.2.60.0060.00616.67
7.1.330.0060.00915.56
7.1.320.0080.00415.72
7.1.310.0060.00615.86
7.1.300.0090.00915.76
7.1.290.0000.00815.68
7.1.280.0110.00315.71
7.1.270.0040.00815.73
7.1.260.0030.00915.86
7.1.200.0080.00415.45
7.1.90.0100.00518.08
7.1.80.0060.00718.39
7.1.70.0000.01217.13
7.1.60.0190.00934.96
7.1.50.0130.01334.73
7.1.40.0160.01334.36
7.1.30.0140.01434.15
7.1.20.0200.02034.67
7.1.10.0080.00416.56
7.1.00.0070.00716.49
7.0.230.0000.01418.01
7.0.220.0000.01317.38
7.0.210.0040.00816.81
7.0.200.0060.00616.64
7.0.190.0070.00716.82
7.0.180.0030.01216.29
7.0.170.0060.01216.07
7.0.160.0000.01316.19
7.0.150.0100.00316.00
7.0.140.0090.00616.15
7.0.130.0040.01116.51
7.0.120.0080.00516.23
7.0.110.0060.00616.56
7.0.100.0030.01016.40
7.0.90.0030.00916.24
7.0.80.0110.00316.42
7.0.70.0000.01416.37
7.0.60.0060.00616.03
7.0.50.0080.00616.38
7.0.40.0100.00316.52
7.0.30.0000.01316.54
7.0.20.0090.00616.45
7.0.10.0060.01016.63
7.0.00.0090.00916.27

preferences:
23.38 ms | 401 KiB | 5 Q