3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = Array ( 'items' => Array ( '0' => Array ( 'sku' => 'SCB20', 'custom_attributes' => Array ( '0' => Array ( 'attribute_code' => 'ages', 'value' => 17 ), '1' => Array ( 'attribute_code' => 'description', 'value' => 'description data' ), '2' => Array ( 'attribute_code' => 'image', 'value' => 'cl2eojpu9.jpg' ) ) ) ) ); $searchCode = 'ages'; $attributeValue = ''; $flag = false; array_walk_recursive($a, function($item, $key, &$flag) use ($searchCode,&$attributeValue){ if($key == 'attribute_code' && $item == $searchCode){ $flag = true; } if($flag){ $attributeValue = $item; } }, $flag); echo $attributeValue;

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.0100.00316.63
8.3.50.0150.00321.15
8.3.40.0070.00718.76
8.3.30.0130.00318.84
8.3.20.0020.00521.73
8.3.10.0050.00320.08
8.3.00.0090.00023.71
8.2.180.0210.00025.92
8.2.170.0070.01119.09
8.2.160.0110.00722.96
8.2.150.0060.00324.18
8.2.140.0070.00024.66
8.2.130.0000.00826.16
8.2.120.0000.00821.18
8.2.110.0030.00620.35
8.2.100.0080.00417.72
8.2.90.0080.00017.97
8.2.80.0050.00517.97
8.2.70.0000.00817.75
8.2.60.0030.00618.05
8.2.50.0000.00918.07
8.2.40.0060.00318.04
8.2.30.0000.00718.07
8.2.20.0040.00418.14
8.2.10.0040.00419.32
8.2.00.0060.00319.22
8.1.280.0090.00625.92
8.1.270.0040.00422.20
8.1.260.0000.00826.35
8.1.250.0000.00828.09
8.1.240.0040.00420.68
8.1.230.0040.00722.12
8.1.220.0030.00617.77
8.1.210.0040.00418.82
8.1.200.0040.00417.35
8.1.190.0000.00817.23
8.1.180.0040.00418.10
8.1.170.0040.00418.50
8.1.160.0040.00418.80
8.1.150.0040.00418.94
8.1.140.0000.00720.78
8.1.130.0030.00320.15
8.1.120.0040.00417.39
8.1.110.0030.00617.53
8.1.100.0000.00817.47
8.1.90.0040.00717.39
8.1.80.0090.00017.48
8.1.70.0000.00717.39
8.1.60.0040.00417.47
8.1.50.0040.00417.53
8.1.40.0080.00017.52
8.1.30.0070.00017.53
8.1.20.0000.00817.68
8.1.10.0030.00517.52
8.1.00.0040.00417.39
8.0.300.0000.00719.86
8.0.290.0050.00216.75
8.0.280.0070.00018.43
8.0.270.0030.00517.14
8.0.260.0060.00020.00
8.0.250.0090.00017.01
8.0.240.0030.00316.91
8.0.230.0000.00717.06
8.0.220.0040.00417.02
8.0.210.0000.00716.80
8.0.200.0060.00017.02
8.0.190.0050.00517.06
8.0.180.0000.00816.82
8.0.170.0000.00917.03
8.0.160.0000.00716.97
8.0.150.0070.00016.95
8.0.140.0030.00516.80
8.0.130.0060.00013.38
8.0.120.0040.00416.83
8.0.110.0050.00216.81
8.0.100.0000.00716.83
8.0.90.0000.00916.95
8.0.80.0060.00916.84
8.0.70.0070.00016.79
8.0.60.0050.00316.79
8.0.50.0040.00416.98
8.0.30.0100.00617.14
8.0.20.0100.01017.15
8.0.10.0000.00717.13
8.0.00.0120.00616.81
7.4.330.0060.00015.55
7.4.320.0070.00016.61
7.4.300.0030.00316.52
7.4.290.0050.00316.51
7.4.280.0000.00716.44
7.4.270.0000.00716.52
7.4.260.0000.00613.21
7.4.250.0060.00316.46
7.4.240.0050.00216.44
7.4.230.0030.00316.40
7.4.220.0040.00416.55
7.4.210.0050.01016.53
7.4.200.0070.00016.69
7.4.130.0070.01116.56
7.4.120.0140.00616.61
7.4.110.0100.00716.38
7.4.100.0090.00916.54
7.4.90.0100.00716.47
7.4.80.0110.00619.39
7.4.70.0070.01516.52
7.4.60.0150.00616.58
7.4.50.0000.01016.55
7.4.40.0070.01116.57
7.4.10.0120.00614.84
7.4.00.0060.01014.87
7.3.330.0000.00716.37
7.3.320.0050.00013.43
7.3.310.0000.00716.40
7.3.300.0000.00716.25
7.3.290.0030.00316.24
7.3.280.0120.00616.34
7.3.260.0100.01016.49
7.3.240.0080.01116.54
7.3.230.0180.00016.30
7.3.210.0110.00716.34
7.3.200.0110.01116.57
7.3.190.0140.00716.32
7.3.180.0080.00816.39
7.3.170.0110.00816.49
7.3.160.0030.01216.54
7.3.130.0100.01014.91
7.3.120.0050.01314.71
7.3.110.0020.01514.87
7.3.100.0070.00814.98
7.3.90.0100.00314.98
7.3.80.0080.00614.90
7.3.70.0070.00814.69
7.3.60.0050.01014.83
7.3.50.0060.00814.77
7.3.40.0100.00414.86
7.3.30.0040.01114.68
7.3.20.0110.00416.60
7.3.10.0030.01116.63
7.3.00.0060.00816.77
7.2.330.0060.01316.79
7.2.320.0090.00916.86
7.2.310.0080.00816.86
7.2.300.0110.00516.81
7.2.290.0130.00316.66
7.2.260.0070.01315.17
7.2.250.0060.01215.14
7.2.240.0070.01014.98
7.2.230.0050.00915.16
7.2.220.0070.01014.81
7.2.210.0080.00914.83
7.2.200.0030.01115.07
7.2.190.0050.00715.03
7.2.180.0020.01315.00
7.2.170.0060.00915.14
7.2.160.0090.00614.85
7.2.150.0030.01316.93
7.2.140.0070.00816.83
7.2.130.0040.00916.83
7.2.120.0100.00816.82
7.2.110.0060.01016.82
7.2.100.0050.00716.92
7.2.90.0190.00716.88
7.2.80.0060.00816.93
7.2.70.0030.00916.87
7.2.60.0070.00916.92
7.2.50.0080.00616.91
7.2.40.0080.00516.20
7.2.30.0060.00716.88
7.2.20.0090.00616.83
7.2.10.0060.00916.93
7.2.00.0060.00716.96
7.1.330.0070.00815.93
7.1.320.0020.01015.61
7.1.310.0110.01115.71
7.1.300.0050.00715.95
7.1.290.0040.01015.63
7.1.280.0030.00815.76
7.1.270.0070.00715.79
7.1.260.0100.00815.86
7.1.250.0050.01015.92
7.1.240.0020.01015.97
7.1.230.0040.00815.78
7.1.220.0030.01215.73
7.1.210.0050.00715.87
7.1.200.0030.00915.81
7.1.190.0030.00815.87
7.1.180.0070.00615.85
7.1.170.0040.00615.77
7.1.160.0050.00615.85
7.1.150.0010.01215.90
7.1.140.0080.00515.79
7.1.130.0030.00915.60
7.1.120.0070.00815.74
7.1.110.0040.00715.90
7.1.100.0020.01015.96
7.1.90.0020.00915.75
7.1.80.0040.00715.73
7.1.70.0040.00615.74
7.1.60.0060.00815.80
7.1.50.0030.01015.78
7.1.40.0020.01115.66
7.1.30.0040.00515.67
7.1.20.0040.01215.89
7.1.10.0060.00615.88
7.1.00.0070.00815.75

preferences:
36.28 ms | 404 KiB | 6 Q