3v4l.org

run code in 300+ PHP versions simultaneously
<?php function searchFromArray($array, $keyword) { echo "\n".$keyword."\n"; $result = array(); if (count($keyword) == 2) { $result[] = $array[$keyword[0]]; } else { foreach ($keyword as $kw => $vw) { if (isset($array[$vw])) { if (is_array($array[$vw])) { unset($keyword[0]); searchFromArray($array[$vw], $keyword); } else { $result[] = $array[$vw]; } } } } return $result; } $array_search = array( 'offset' => '', 'count' => '', 'max_count' => '', 'content_list' => array(array( 'content' => array( 'id'=>'1', 'type'=>'', 'name_title'=>'', 'parent_id'=>'', 'rating_type'=>'', 'link_url'=>'', 'tag' => array( 'id' => 'tag_id_1', 'name' => 'tag_name_1' ), 'image_dir'=>'', 'image_url'=>'', 'image_dir_thumb'=>'x', 'image_url_thumb'=>'' ), 'content' => array( 'id'=>'2', 'type'=>'', 'name_title'=>'', 'parent_id'=>'', 'rating_type'=>'', 'link_url'=>'', 'tag' => array( 'id' => 'tag_id_2', 'name' => 'tag_name_2' ), 'image_dir'=>'', 'image_url'=>'', 'image_dir_thumb'=>'y', 'image_url_thumb'=>'' ) ) ) ); $keyword = array('content_list', 'content', 'tag'); $result = searchFromArray($array_search, $keyword); var_dump($result);

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.0160.00016.88
8.3.60.0090.00916.88
8.3.50.0050.01521.16
8.3.40.0030.01218.82
8.3.30.0030.01018.95
8.3.20.0070.00020.15
8.3.10.0040.00421.60
8.3.00.0090.00019.56
8.2.180.0120.00918.54
8.2.170.0120.00319.21
8.2.160.0070.00722.96
8.2.150.0030.00624.18
8.2.140.0050.00324.66
8.2.130.0030.00626.16
8.2.120.0040.00419.66
8.2.110.0040.00420.99
8.2.100.0080.00418.03
8.2.90.0040.00419.40
8.2.80.0000.00817.97
8.2.70.0030.00617.73
8.2.60.0090.00318.03
8.2.50.0070.00418.10
8.2.40.0050.00318.28
8.2.30.0040.00418.18
8.2.20.0040.00417.84
8.2.10.0040.00418.22
8.2.00.0030.00618.14
8.1.280.0130.01025.92
8.1.270.0070.00020.23
8.1.260.0030.00626.35
8.1.250.0040.00428.09
8.1.240.0030.00622.13
8.1.230.0040.00817.96
8.1.220.0000.00917.88
8.1.210.0090.00018.77
8.1.200.0070.00317.23
8.1.190.0040.00417.35
8.1.180.0090.00018.10
8.1.170.0100.00018.53
8.1.160.0040.00422.03
8.1.150.0000.00718.55
8.1.140.0000.00717.40
8.1.130.0000.00717.90
8.1.120.0040.00417.52
8.1.110.0000.00717.47
8.1.100.0070.00017.37
8.1.90.0040.00417.53
8.1.80.0040.00417.51
8.1.70.0030.00317.35
8.1.60.0030.00517.50
8.1.50.0000.00817.58
8.1.40.0050.00217.44
8.1.30.0000.00817.64
8.1.20.0000.00817.59
8.1.10.0040.00417.66
8.1.00.0040.00417.48
8.0.300.0000.00718.77
8.0.290.0070.00016.88
8.0.280.0030.00318.40
8.0.270.0000.00717.23
8.0.260.0000.00617.34
8.0.250.0000.00817.13
8.0.240.0030.00317.09
8.0.230.0030.00317.03
8.0.220.0030.00316.99
8.0.210.0070.00016.94
8.0.200.0030.00317.07
8.0.190.0040.00416.93
8.0.180.0030.00516.90
8.0.170.0060.00316.88
8.0.160.0070.00016.92
8.0.150.0070.00016.93
8.0.140.0050.00216.83
8.0.130.0070.00013.46
8.0.120.0040.00416.85
8.0.110.0000.00817.00
8.0.100.0030.00516.92
8.0.90.0090.00017.11
8.0.80.0040.01116.88
8.0.70.0030.00516.87
8.0.60.0050.00316.89
8.0.50.0000.00716.89
8.0.30.0100.00817.07
8.0.20.0090.01017.40
8.0.10.0080.00017.00
8.0.00.0090.01016.83
7.4.330.0030.00315.03
7.4.320.0040.00416.49
7.4.300.0060.00016.65
7.4.290.0040.00416.52
7.4.280.0040.00416.52
7.4.270.0030.00316.45
7.4.260.0070.00016.62
7.4.250.0030.00516.55
7.4.240.0020.00516.57
7.4.230.0000.00716.38
7.4.220.0100.01016.54
7.4.210.0120.00616.54
7.4.200.0000.00716.66
7.4.160.0120.00316.54
7.4.150.0040.01317.40
7.4.140.0060.01317.86
7.4.130.0100.01216.55
7.4.120.0050.01316.57
7.4.110.0100.00716.74
7.4.100.0080.01216.68
7.4.90.0100.00716.50
7.4.80.0170.00619.39
7.4.70.0120.01216.63
7.4.60.0160.00716.35
7.4.50.0070.00016.48
7.4.40.0090.00916.52
7.4.30.0060.01016.50
7.4.00.0030.01414.88
7.3.330.0060.00313.45
7.3.320.0000.00613.29
7.3.310.0080.00016.30
7.3.300.0030.00316.25
7.3.290.0060.01216.46
7.3.280.0100.00716.42
7.3.270.0030.01417.40
7.3.260.0100.00716.52
7.3.250.0110.00816.52
7.3.240.0080.00816.68
7.3.230.0100.01516.57
7.3.210.0060.01316.62
7.3.200.0090.01516.43
7.3.190.0100.00516.62
7.3.180.0040.01216.47
7.3.170.0090.01116.52
7.3.160.0150.00716.52
7.2.330.0070.01016.81
7.2.320.0090.00816.59
7.2.310.0090.00916.70
7.2.300.0090.00616.86
7.2.290.0180.00716.54
7.2.00.0000.01319.62
7.1.200.0030.01015.78
7.1.100.0000.01218.14
7.1.70.0000.01417.26
7.1.60.0130.01019.86
7.1.50.0150.00716.85
7.1.00.0000.08022.27
7.0.200.0070.00316.79
7.0.60.0330.05021.63
7.0.50.0070.07317.98
7.0.40.0170.08020.23
7.0.30.0330.07720.10
7.0.20.0370.08020.27
7.0.10.0100.04020.19
7.0.00.0030.06020.15
5.6.280.0000.07721.11
5.6.210.0070.09020.48
5.6.200.0100.08318.11
5.6.190.0030.08720.67
5.6.180.0300.04720.33
5.6.170.0230.06020.47
5.6.160.0130.07720.55
5.6.150.0000.06318.18
5.6.140.0070.03718.18
5.6.130.0000.05718.17
5.6.120.0130.07321.02
5.6.110.0000.09321.02
5.6.100.0100.05721.09
5.6.90.0170.05021.11
5.6.80.0100.05020.41
5.5.350.0000.08320.43
5.5.340.0100.07718.08
5.5.330.0130.07720.25
5.5.320.3130.03720.36
5.5.310.0230.08020.30
5.5.300.0100.07717.95
5.5.290.0070.04017.99
5.5.280.0130.08320.91
5.5.270.0100.03320.97
5.5.260.0100.05320.77
5.5.250.0030.04720.59
5.5.240.0100.07020.30
5.4.450.0100.04019.30
5.4.440.0500.03319.39
5.4.430.0070.06019.23
5.4.420.0130.05319.16
5.4.410.0100.05718.94
5.4.400.0170.04718.88
5.4.390.0070.05718.51
5.4.380.0030.06718.77
5.4.370.0130.05718.61
5.4.360.0200.04018.60
5.4.350.0070.05718.62
5.4.340.0070.05718.45
5.4.320.0170.04718.68
5.4.310.0070.05318.82
5.4.300.0070.05318.50
5.4.290.0130.06018.57
5.4.280.0030.06018.52
5.4.270.0030.06718.70
5.4.260.0130.05018.51
5.4.250.0170.04718.46
5.4.240.0130.06018.60
5.4.230.0070.05318.74
5.4.220.0200.04318.61
5.4.210.0070.05318.49
5.4.200.0200.04316.70
5.4.190.0100.05018.68
5.4.180.0030.05718.67
5.4.170.0170.05318.52
5.4.160.0030.05718.60
5.4.150.0130.04718.52
5.4.140.0100.05016.33
5.4.130.0000.05716.21
5.4.120.0130.04316.44
5.4.110.0070.05016.17
5.4.100.0030.05716.42
5.4.90.0030.05716.22
5.4.80.0170.04016.41
5.4.70.0100.06016.15
5.4.60.0070.05016.20
5.4.50.0100.07016.29
5.4.40.0130.04716.23
5.4.30.0100.04716.15
5.4.20.0170.04316.26
5.4.10.0200.05716.27
5.4.00.0100.05015.76
5.3.290.0100.05314.68
5.3.280.0170.04314.63
5.3.270.0100.05314.65
5.3.260.0030.06014.65
5.3.250.0100.05014.74
5.3.240.0000.06314.64
5.3.230.0100.05014.59
5.3.220.0030.06714.75
5.3.210.0170.05714.59
5.3.200.0100.05314.62
5.3.190.0030.05714.71
5.3.180.0170.06314.63
5.3.170.0100.06714.61
5.3.160.0230.05014.73
5.3.150.0070.06714.75
5.3.140.0100.05314.64
5.3.130.0100.05314.59
5.3.120.0030.05714.60
5.3.110.0170.04714.61
5.3.100.0130.05014.14
5.3.90.0170.06014.13
5.3.80.0100.06014.23
5.3.70.0130.04714.10
5.3.60.0070.05314.07
5.3.50.0200.04014.16
5.3.40.0130.05013.94
5.3.30.0070.05314.12
5.3.20.0030.05313.72
5.3.10.0100.04713.69
5.3.00.0030.05713.70
5.2.170.0100.04311.15
5.2.160.0100.04311.17
5.2.150.0000.04711.17
5.2.140.0070.04011.19
5.2.130.0070.05011.18
5.2.120.0130.03311.24
5.2.110.0030.04311.21
5.2.100.0030.04311.17
5.2.90.0170.04711.11
5.2.80.0070.04011.08
5.2.70.0000.05011.18
5.2.60.0070.04311.18
5.2.50.0000.04711.15
5.2.40.0070.03711.11
5.2.30.0100.03711.20
5.2.20.0100.03711.00
5.2.10.0000.04310.96
5.2.00.0030.04310.78
5.1.60.0030.03710.02
5.1.50.0100.03010.13
5.1.40.0070.03310.12
5.1.30.0070.03710.41
5.1.20.0030.03710.41
5.1.10.0100.03010.28
5.1.00.0000.04010.12
5.0.50.0030.0308.74
5.0.40.0070.0308.46
5.0.30.0030.0438.29
5.0.20.0000.0308.39
5.0.10.0070.0338.23
5.0.00.0070.0408.32
4.4.90.0030.0235.95
4.4.80.0030.0235.93
4.4.70.0100.0236.01
4.4.60.0070.0275.96
4.4.50.0070.0236.04
4.4.40.0030.0335.90
4.4.30.0030.0305.89
4.4.20.0030.0206.05
4.4.10.0030.0236.03
4.4.00.0070.0375.93
4.3.110.0100.0235.82
4.3.100.0170.0175.84
4.3.90.0030.0305.89
4.3.80.0030.0375.82
4.3.70.0070.0275.85
4.3.60.0030.0275.82
4.3.50.0030.0205.93
4.3.40.0000.0375.78
4.3.30.0030.0234.60
4.3.20.0000.0234.59
4.3.10.0070.0174.63
4.3.00.0000.02015.52

preferences:
61.06 ms | 401 KiB | 5 Q