3v4l.org

run code in 300+ PHP versions simultaneously
<?php $user = [ 'firstname' => 'first', 'middle' => 'middle', 'lastname' => 'last', 'address' => [ 'street' => 'streeeeeet', 'housenumber' => '10' ] ]; $interestingKeys = [ 'address', 'someOtherKey' ]; foreach ($user as $key => $val) { //is it in the keys we're interested in, and is it an array (sub array of $user)? if (in_array($key, $interestingKeys) && is_array($val)){ // Scan through inner loop foreach ($val as $sub_val) { echo "$sub_val\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.3.60.0080.00816.63
8.3.50.0120.00318.05
8.3.40.0060.01218.73
8.3.30.0130.00918.75
8.3.20.0040.00420.33
8.3.10.0000.00822.05
8.3.00.0040.00423.51
8.2.180.0140.00718.41
8.2.170.0140.00718.96
8.2.160.0100.00320.38
8.2.150.0080.00024.18
8.2.140.0000.00824.66
8.2.130.0070.00019.44
8.2.120.0040.00426.35
8.2.110.0120.00019.37
8.2.100.0030.00917.78
8.2.90.0000.00817.82
8.2.80.0110.00017.97
8.2.70.0040.00418.04
8.2.60.0030.00517.80
8.2.50.0060.00318.10
8.2.40.0060.00320.41
8.2.30.0050.00319.24
8.2.20.0060.00318.04
8.2.10.0040.00418.12
8.2.00.0000.00818.02
8.1.280.0090.00625.92
8.1.270.0030.00522.05
8.1.260.0000.00826.35
8.1.250.0070.00028.09
8.1.240.0060.00319.21
8.1.230.0090.00320.97
8.1.220.0000.00817.74
8.1.210.0040.00418.77
8.1.200.0090.00017.23
8.1.190.0000.00817.22
8.1.180.0000.00918.10
8.1.170.0040.00418.63
8.1.160.0040.00418.77
8.1.150.0070.00020.12
8.1.140.0040.00419.59
8.1.130.0000.00720.54
8.1.120.0080.00417.45
8.1.110.0080.00017.51
8.1.100.0040.00417.33
8.1.90.0000.00817.42
8.1.80.0040.00417.43
8.1.70.0030.00517.43
8.1.60.0040.00417.57
8.1.50.0040.00417.47
8.1.40.0070.00017.39
8.1.30.0040.00417.52
8.1.20.0080.00017.66
8.1.10.0040.00417.52
8.1.00.0000.00717.27
8.0.300.0040.00419.98
8.0.290.0000.01116.60
8.0.280.0030.00318.45
8.0.270.0070.00017.13
8.0.260.0000.00718.40
8.0.250.0040.00416.83
8.0.240.0000.00716.90
8.0.230.0070.00016.95
8.0.220.0030.00316.86
8.0.210.0000.00716.88
8.0.200.0040.00416.94
8.0.190.0040.00417.00
8.0.180.0040.00416.81
8.0.170.0000.00716.80
8.0.160.0050.00216.99
8.0.150.0000.00716.69
8.0.140.0000.00716.75
8.0.130.0000.00613.31
8.0.120.0040.00416.82
8.0.110.0040.00416.82
8.0.100.0000.00816.92
8.0.90.0050.00216.95
8.0.80.0090.00616.82
8.0.70.0070.00016.92
8.0.60.0040.00416.77
8.0.50.0040.00416.88
8.0.30.0100.00817.14
8.0.20.0110.01117.40
8.0.10.0040.00417.04
8.0.00.0070.01116.62
7.4.330.0060.00015.55
7.4.320.0060.00016.52
7.4.300.0060.00016.59
7.4.290.0040.00416.58
7.4.280.0000.00816.50
7.4.270.0030.00316.62
7.4.260.0030.00616.34
7.4.250.0040.00416.47
7.4.240.0080.00016.55
7.4.230.0030.00316.57
7.4.220.0120.00916.54
7.4.210.0070.00716.56
7.4.200.0050.00216.64
7.4.160.0090.00816.52
7.4.150.0120.01217.40
7.4.140.0120.00717.86
7.4.130.0060.01216.39
7.4.120.0090.00916.54
7.4.110.0110.00616.48
7.4.100.0070.01116.52
7.4.90.0090.00916.63
7.4.80.0090.00919.39
7.4.70.0160.00316.38
7.4.60.0190.00816.52
7.4.50.0040.01116.30
7.4.40.0060.01616.41
7.4.30.0160.00316.32
7.4.10.0030.01716.32
7.4.00.0120.00615.23
7.3.330.0000.00613.02
7.3.320.0030.00313.10
7.3.310.0030.00316.35
7.3.300.0000.00716.16
7.3.290.0070.00016.25
7.3.280.0080.00816.23
7.3.270.0080.00817.40
7.3.260.0070.01116.51
7.3.250.0140.00516.36
7.3.240.0110.00716.50
7.3.230.0080.00816.60
7.3.210.0130.01316.29
7.3.200.0090.00616.29
7.3.190.0100.00716.23
7.3.180.0060.01016.46
7.3.170.0130.01016.49
7.3.160.0100.00916.43
7.3.130.0090.01216.53
7.3.120.0090.01015.40
7.3.110.0060.01115.31
7.3.100.0050.00915.40
7.3.90.0070.00815.36
7.3.80.0050.00815.41
7.3.70.0090.00415.27
7.3.60.0060.00615.28
7.3.50.0050.00715.15
7.3.40.0070.00315.32
7.3.30.0060.00715.29
7.3.20.0070.00417.02
7.3.10.0020.01117.08
7.3.00.0040.00917.17
7.2.330.0130.00416.34
7.2.320.0030.01916.75
7.2.310.0150.00016.55
7.2.300.0140.00316.61
7.2.290.0080.00816.54
7.2.260.0040.01416.66
7.2.250.0070.01015.46
7.2.240.0030.01415.57
7.2.230.0070.01115.53
7.2.220.0070.00515.63
7.2.210.0060.00815.42
7.2.200.0070.00615.43
7.2.190.0050.01115.49
7.2.180.0070.00415.60
7.2.170.0070.00615.37
7.2.160.0060.00616.49
7.2.150.0030.00618.48
7.2.140.0060.00918.42
7.2.130.0090.00618.39
7.2.120.0090.00318.44
7.2.110.0040.01418.21
7.2.100.0070.01018.03
7.2.90.0030.00618.13
7.2.80.0070.00817.36
7.2.70.0000.01218.34
7.2.60.0040.00717.68
7.2.50.0050.00818.51
7.2.40.0070.00718.33
7.2.30.0060.00618.29
7.2.20.0080.00418.34
7.2.10.0060.01018.29
7.2.00.0030.01018.31
7.1.330.0030.01216.50
7.1.320.0040.00616.21
7.1.310.0050.00716.54
7.1.300.0040.00816.31
7.1.290.0030.01016.24
7.1.280.0030.01016.32
7.1.270.0020.01016.32
7.1.260.0050.00616.13
7.1.250.0080.00317.29
7.1.240.0000.01117.13
7.1.230.0060.00617.39
7.1.220.0000.01517.20
7.1.210.0110.00017.42
7.1.200.0020.00916.55
7.1.190.0000.01117.41
7.1.180.0000.00917.25
7.1.170.0070.00417.23
7.1.160.0000.00917.37
7.1.150.0040.00817.32
7.1.140.0030.00717.48
7.1.130.0070.00317.19
7.1.120.0040.00817.33
7.1.110.0000.01417.32
7.1.100.0100.00317.46
7.1.90.0060.00716.79
7.1.80.0170.00916.88
7.1.70.0090.00417.34
7.1.60.0270.00925.48
7.1.50.0130.01226.00
7.1.40.0220.00325.83
7.1.30.0310.01425.04
7.1.20.0120.01125.97
7.1.10.0280.00716.00
7.1.00.0410.01217.02
7.0.330.0060.00616.95
7.0.320.0030.01316.89
7.0.310.0030.01017.03
7.0.300.0000.00816.97
7.0.290.0080.00617.07
7.0.280.0040.01117.14
7.0.270.0030.01317.10
7.0.260.0040.01116.95
7.0.250.0060.00617.11
7.0.240.0040.00817.05
7.0.230.0270.00916.52
7.0.220.0070.00917.30
7.0.210.0230.00915.87
7.0.200.0080.00716.91
7.0.190.0260.00816.72
7.0.180.0060.00616.54
7.0.170.0250.00815.62
7.0.160.0290.00915.60
7.0.150.0300.00715.67
7.0.140.0700.00916.72
7.0.130.0410.00716.78
7.0.120.0090.00716.78
7.0.110.0230.00815.67
7.0.100.0220.01015.76
7.0.90.0320.01015.85
7.0.80.0220.00815.68
7.0.70.0180.00915.77
7.0.60.0160.00816.46
7.0.50.0200.01016.68
7.0.40.0210.00814.82
7.0.30.0060.00615.71
7.0.20.0190.00514.64
7.0.10.0040.00715.63
7.0.00.0200.00914.79
5.6.400.0060.00316.00
5.6.390.0090.00316.02
5.6.380.0060.00615.89
5.6.370.0070.00415.74
5.6.360.0080.00315.65
5.6.350.0120.00015.70
5.6.340.0040.00815.72
5.6.330.0070.00716.02
5.6.320.0030.01015.81
5.6.310.0060.00615.92
5.6.300.0040.00415.78
5.6.290.0070.01015.95
5.6.280.0040.01116.00
5.6.270.0060.00616.00
5.6.260.0030.01015.71
5.6.250.0060.00315.99
5.6.240.0060.00915.73
5.6.230.0060.00615.81
5.6.220.0080.00815.63
5.6.210.0070.00715.86
5.6.200.0090.00615.75
5.6.190.0100.00015.98
5.6.180.0030.01215.82
5.6.170.0080.00415.95
5.6.160.0070.00315.65
5.6.150.0050.00515.67
5.6.140.0040.01115.94
5.6.130.0120.00315.96
5.6.120.0000.01115.86
5.6.110.0090.00615.92
5.6.100.0080.00415.73
5.6.90.0070.00415.86
5.6.80.0040.00815.81
5.6.70.0040.00815.62
5.6.60.0080.00415.74
5.6.50.0060.00615.71
5.6.40.0060.00615.67
5.6.30.0090.00315.77
5.6.20.0060.00915.71
5.6.10.0040.00815.70
5.6.00.0080.00415.76

preferences:
67.25 ms | 401 KiB | 5 Q