3v4l.org

run code in 500+ PHP versions simultaneously
<?php $arr = array ( 0 => array ( 'id' => '1', 'p_pag' => '0', 'link' => 'Contact', 'children' => array ( 0 => array ( 'id' => '2', 'p_pag' => '1', 'link' => 'Contact-County', 'children' => array ( 0 => array ( 'id' => '3', 'p_pag' => '2', 'link' => 'Contact-Town-1', 'children' => array ( ), ), ), ), ), ), ); $searchId = 3; $link = null; $iterator = new \RecursiveIteratorIterator( new \RecursiveArrayIterator($arr),\RecursiveIteratorIterator::SELF_FIRST ); foreach($iterator as $subarr){ if(is_array($subarr) && array_key_exists('id',$subarr) && $subarr['id'] == $searchId){ $link = $subarr['link']; break; } } echo $link ? $link : 'not found';

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.5.70.0080.00616.91
8.5.60.0120.00616.64
8.5.50.0100.00716.77
8.5.30.0110.00621.21
8.5.20.0120.00819.37
8.5.10.0140.00320.27
8.5.00.0120.00920.16
8.4.210.0120.00921.39
8.4.180.0100.01219.61
8.4.170.0120.00923.82
8.4.160.0120.01122.97
8.4.150.0070.00416.90
8.4.140.0150.00817.39
8.4.130.0110.01017.75
8.4.120.0120.00920.75
8.4.110.0120.00722.52
8.4.100.0070.00417.63
8.4.90.0110.00922.48
8.4.80.0070.00417.78
8.4.70.0090.01119.51
8.4.60.0130.00718.55
8.4.50.0050.00522.36
8.4.40.0150.00419.49
8.4.30.0100.01018.92
8.4.20.0100.01017.98
8.4.10.0050.00523.97
8.3.300.0130.00818.56
8.3.290.0100.01120.66
8.3.280.0090.01118.68
8.3.270.0090.01016.68
8.3.260.0110.00716.71
8.3.250.0110.00720.98
8.3.240.0120.00716.61
8.3.230.0060.00316.38
8.3.220.0100.00817.32
8.3.210.0020.00618.52
8.3.200.0020.00716.66
8.3.190.0080.00217.41
8.3.180.0090.00716.82
8.3.170.0110.00717.00
8.3.160.0110.00716.45
8.3.150.0130.00317.01
8.3.140.0070.01116.80
8.3.130.0090.00018.36
8.3.120.0160.00318.74
8.3.110.0130.00620.94
8.3.100.0100.01016.63
8.3.90.0200.00018.53
8.3.80.0090.00016.37
8.3.70.0040.01116.85
8.3.60.0080.00816.75
8.3.50.0140.00420.09
8.3.40.0090.00622.09
8.3.30.0140.00718.71
8.3.20.0040.00424.18
8.3.10.0040.00424.66
8.3.00.0050.00326.16
8.2.300.0110.00918.03
8.2.290.0120.00720.71
8.2.280.0070.01218.21
8.2.270.0120.00616.93
8.2.260.0040.01520.78
8.2.250.0160.00616.45
8.2.240.0030.00716.96
8.2.230.0150.00722.58
8.2.220.0140.00724.06
8.2.210.0120.00626.77
8.2.200.0060.00316.38
8.2.190.0120.00616.58
8.2.180.0160.00725.92
8.2.170.0090.00918.84
8.2.160.0030.01022.96
8.2.150.0040.00425.66
8.2.140.0050.00324.66
8.2.130.0060.00326.16
8.2.120.0000.00826.16
8.2.110.0130.00721.11
8.2.100.0090.00617.84
8.2.90.0040.00417.97
8.2.80.0000.00818.16
8.2.70.0040.00417.63
8.2.60.0080.00018.05
8.2.50.0050.00318.05
8.2.40.0070.00518.09
8.2.30.0040.00418.05
8.2.20.0000.00719.36
8.2.10.0000.00718.01
8.2.00.0040.00419.21
8.1.340.0120.00917.67
8.1.330.0090.00821.79
8.1.320.0140.00616.00
8.1.310.0070.01116.73
8.1.300.0120.00318.04
8.1.290.0060.00330.84
8.1.280.0110.00325.92
8.1.270.0040.00423.60
8.1.260.0040.00426.35
8.1.250.0000.00828.09
8.1.240.0170.00322.50
8.1.230.0080.00420.60
8.1.220.0040.00417.79
8.1.210.0000.00819.03
8.1.200.0060.00317.23
8.1.190.0080.00017.10
8.1.180.0050.00518.10
8.1.170.0050.00318.59
8.1.160.0000.00719.01
8.1.150.0040.00418.55
8.1.140.0040.00417.45
8.1.130.0050.00322.05
8.1.120.0060.00317.50
8.1.110.0090.00617.48
8.1.100.0050.01017.34
8.1.90.0130.00217.45
8.1.80.0130.00217.50
8.1.70.0090.00617.28
8.1.60.0040.01417.54
8.1.50.0170.00017.54
8.1.40.0130.00517.42
8.1.30.0100.00717.57
8.1.20.0150.00317.50
8.1.10.0120.00417.50
8.1.00.0160.00317.52
8.0.300.0040.00420.03
8.0.290.0040.00416.75
8.0.280.0040.00418.44
8.0.270.0070.00017.27
8.0.260.0000.01018.50
8.0.250.0030.00516.94
8.0.240.0120.00416.82
8.0.230.0050.01016.92
8.0.220.0080.00816.86
8.0.210.0140.00016.80
8.0.200.0150.00016.86
8.0.190.0090.00516.92
8.0.180.0120.00316.89
8.0.170.0100.00516.80
8.0.160.0150.00016.76
8.0.150.0040.01016.84
8.0.140.0040.00916.85
8.0.130.0110.00416.80
8.0.120.0060.00816.89
8.0.110.0080.00616.91
8.0.100.0110.00416.92
8.0.90.0150.00016.69
8.0.80.0130.00016.86
8.0.70.0060.00916.77
8.0.60.0080.00416.82
8.0.50.0110.00216.78
8.0.30.0120.00416.88
8.0.20.0120.00316.97
8.0.10.0100.00517.01
7.4.330.0060.00015.55
7.4.320.0100.00016.51
7.4.300.0000.01016.63
7.4.290.0100.00016.56
7.4.280.0110.00016.48
7.4.270.0160.00016.50
7.4.260.0060.00316.63
7.4.250.0030.00716.55
7.4.240.0040.00716.58
7.4.230.0060.00316.52
7.4.220.0030.00716.50
7.4.210.0070.00316.55
7.4.200.0030.00616.56
7.4.190.0090.00016.58
7.4.180.0000.01016.42
7.4.160.0000.01016.61
7.4.150.0090.00016.56
7.4.140.0090.00216.34
7.4.130.0100.00016.41
7.4.120.0030.00716.22
7.4.110.0050.00516.44
7.4.100.0080.00316.36
7.4.90.0050.00516.21
7.4.80.0100.00015.95
7.4.70.0070.00316.22
7.4.60.0060.00516.14
7.4.50.0030.00716.18
7.4.40.0050.00516.36
7.4.30.0030.00616.25
7.4.20.0060.00416.26
7.4.10.0050.00516.44
7.4.00.0050.00516.11

preferences:
91.26 ms | 1249 KiB | 5 Q