3v4l.org

run code in 300+ PHP versions simultaneously
<?php $testarr = array( 'advertiser' => array( 'id'=>345343, 'name'=>'Advertiser123', 'agency' => array( 'id'=>345343, 'name'=>'Agency456', 'organisation' => array( 'id'=>223334, 'name'=>'Organisation456' ) ) ) ); function getkeypath($arr, $lookup) { if (in_array($lookup, $arr)) { return array($lookup); } else { foreach ($arr as $key => $subarr) { if (is_array($subarr)) { $ret = getkeypath($subarr, $lookup); if ($ret) { $ret[] = $key; return $ret; } } } } return null; } echo '$testarr: ' . "\n"; print_r($testarr); echo "\n" . '7: ' . "\n" . print_r(getkeypath($testarr, 223334), true) . "\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.0070.00718.30
8.3.50.0150.00521.95
8.3.40.0110.00818.97
8.3.30.0150.00019.07
8.3.20.0050.00220.34
8.3.10.0040.00423.69
8.3.00.0050.00219.02
8.2.180.0150.00316.75
8.2.170.0100.00322.96
8.2.160.0070.00722.08
8.2.150.0000.00824.18
8.2.140.0080.00024.66
8.2.130.0070.01126.16
8.2.120.0030.00519.66
8.2.110.0060.00322.24
8.2.100.0040.00817.91
8.2.90.0060.00317.63
8.2.80.0000.00817.97
8.2.70.0000.00818.05
8.2.60.0000.00718.28
8.2.50.0030.00618.10
8.2.40.0000.00819.35
8.2.30.0000.00720.45
8.2.20.0000.00817.68
8.2.10.0000.00718.18
8.2.00.0040.00417.63
8.1.280.0180.00425.92
8.1.270.0040.00419.00
8.1.260.0000.00826.35
8.1.250.0180.00028.09
8.1.240.0030.00618.69
8.1.230.0030.00917.66
8.1.220.0040.00717.74
8.1.210.0040.00418.77
8.1.200.0080.00317.23
8.1.190.0040.00417.22
8.1.180.0040.00418.10
8.1.170.0080.00018.59
8.1.160.0080.00018.89
8.1.150.0040.00418.96
8.1.140.0040.00417.39
8.1.130.0000.01017.86
8.1.120.0000.00717.41
8.1.110.0030.00517.38
8.1.100.0000.00817.38
8.1.90.0000.00717.50
8.1.80.0030.00317.47
8.1.70.0030.00317.35
8.1.60.0000.00817.47
8.1.50.0040.00417.44
8.1.40.0000.00817.41
8.1.30.0050.00317.69
8.1.20.0000.00817.64
8.1.10.0080.00017.41
8.1.00.0080.00017.52
8.0.300.0040.00418.77
8.0.290.0040.00416.75
8.0.280.0070.00018.45
8.0.270.0030.00317.23
8.0.260.0070.00017.25
8.0.250.0030.00316.92
8.0.240.0040.00416.99
8.0.230.0030.00316.85
8.0.220.0070.00016.78
8.0.210.0030.00316.91
8.0.200.0070.00016.98
8.0.190.0000.00716.99
8.0.180.0000.00716.94
8.0.170.0030.00516.93
8.0.160.0000.00716.96
8.0.150.0000.00716.71
8.0.140.0040.00416.77
8.0.130.0000.00613.32
8.0.120.0040.00416.89
8.0.110.0000.00716.72
8.0.100.0050.00516.77
8.0.90.0040.00416.89
8.0.80.0000.01516.86
8.0.70.0040.00416.96
8.0.60.0040.00416.92
8.0.50.0020.00516.93
8.0.30.0110.01017.05
8.0.20.0070.01217.40
8.0.10.0000.00816.89
8.0.00.0110.00716.70
7.4.330.0000.00515.08
7.4.320.0060.00016.52
7.4.300.0060.00016.61
7.4.290.0020.00516.52
7.4.280.0000.00816.52
7.4.270.0030.00316.55
7.4.260.0030.00316.61
7.4.250.0070.00016.56
7.4.240.0030.00316.52
7.4.230.0030.00316.49
7.4.220.0120.00616.59
7.4.210.0100.00716.60
7.4.200.0000.00716.55
7.4.160.0090.00616.39
7.4.150.0100.01017.40
7.4.140.0090.01217.86
7.4.130.0050.01316.65
7.4.120.0080.00916.50
7.4.110.0180.00016.62
7.4.100.0090.01216.64
7.4.90.0070.01116.48
7.4.80.0140.00419.39
7.4.70.0080.00816.76
7.4.60.0030.01316.40
7.4.50.0000.00816.52
7.4.40.0100.00716.58
7.4.30.0030.01316.61
7.4.00.0150.00315.01
7.3.330.0060.00013.29
7.3.320.0000.00513.28
7.3.310.0070.00016.18
7.3.300.0000.00716.18
7.3.290.0080.00716.29
7.3.280.0070.01016.30
7.3.270.0090.00917.40
7.3.260.0070.01116.59
7.3.250.0050.01316.53
7.3.240.0090.00616.39
7.3.230.0100.00716.52
7.3.210.0120.00616.32
7.3.200.0100.00719.39
7.3.190.0090.00716.33
7.3.180.0060.00916.71
7.3.170.0090.00916.59
7.3.160.0100.00716.27
7.3.120.0030.01314.57
7.3.110.0090.00915.02
7.3.100.0090.00614.86
7.3.90.0060.00314.72
7.3.80.0100.00615.09
7.3.70.0060.00914.73
7.3.60.0040.01114.95
7.3.50.0030.01214.86
7.3.40.0030.01014.94
7.3.30.0130.00015.00
7.3.20.0060.00616.57
7.3.10.0090.00616.51
7.3.00.0130.00316.66
7.2.330.0130.00716.78
7.2.320.0060.01016.74
7.2.310.0140.00716.62
7.2.300.0090.01616.77
7.2.290.0100.00716.76
7.2.250.0070.01315.11
7.2.240.0120.00915.09
7.2.230.0070.00415.31
7.2.220.0060.00914.95
7.2.210.0030.01215.33
7.2.200.0030.01315.04
7.2.190.0030.01315.04
7.2.180.0070.00715.00
7.2.170.0150.00414.79
7.2.60.0040.01117.05
7.2.00.0030.01019.55
7.1.330.0070.00715.81
7.1.320.0070.00715.81
7.1.310.0070.00715.63
7.1.300.0060.00316.02
7.1.290.0060.00915.84
7.1.280.0030.00915.88
7.1.270.0040.00815.87
7.1.260.0000.01515.84
7.1.200.0080.00615.55
7.1.100.0080.00417.89
7.1.70.0070.00017.01
7.1.60.0100.01419.57
7.1.50.0120.00916.89
7.1.00.0070.07322.28
7.0.200.0040.00416.68
7.0.140.0100.07022.12
7.0.100.0070.04320.00
7.0.90.0030.04319.93
7.0.80.0170.04019.93
7.0.70.0100.03319.95
7.0.60.0030.04019.97
7.0.50.0070.04320.36
7.0.40.0070.04320.08
7.0.30.0130.07020.08
7.0.20.0130.06720.10
7.0.10.0130.07019.95
7.0.00.0100.04720.01
5.6.280.0030.07321.10
5.6.250.0000.04320.72
5.6.240.0070.04320.64
5.6.230.0070.04020.54
5.6.220.0030.04020.65
5.6.210.0030.04320.63
5.6.200.0030.04321.14
5.6.190.0030.04021.02
5.6.180.0070.08021.04
5.6.170.0030.06021.04
5.6.160.0170.07721.18
5.6.150.0070.08320.92
5.6.140.0130.05721.14
5.6.130.0130.07020.95
5.6.120.0100.06720.94
5.6.110.0070.05320.98
5.6.100.0070.05021.03
5.6.90.0130.08021.01
5.6.80.0100.05720.56
5.6.70.0130.04320.32
5.6.60.0070.04320.38
5.6.50.0000.09020.42
5.6.40.0170.03720.41
5.6.30.0030.07720.41
5.6.20.0070.08020.49
5.6.10.0100.08020.43
5.6.00.0130.05720.47
5.5.380.0030.04020.37
5.5.370.0030.04020.40
5.5.360.0000.04320.50
5.5.350.0000.04320.46
5.5.340.0030.07720.90
5.5.330.0070.05720.93
5.5.320.0030.04320.74
5.5.310.0100.04720.87
5.5.300.0100.04720.87
5.5.290.0170.06720.78
5.5.280.0000.08020.65
5.5.270.0030.08320.71
5.5.260.0070.04720.93
5.5.250.0070.07320.65
5.5.240.0170.04020.17
5.5.230.0100.04020.28
5.5.220.0030.08020.24
5.5.210.0130.05020.18
5.5.200.0100.07020.20
5.5.190.0070.07320.15
5.5.180.0170.05720.12
5.5.160.0030.06320.18
5.5.150.0130.07320.25
5.5.140.0200.06020.17
5.5.130.0000.04320.21
5.5.120.0070.08020.23
5.5.110.0030.06320.27
5.5.100.0070.07020.17
5.5.90.0100.07020.09
5.5.80.0070.04720.04
5.5.70.0070.08020.06
5.5.60.0100.05719.95
5.5.50.0170.07020.16
5.5.40.0130.07320.05
5.5.30.0130.05720.14
5.5.20.0070.06020.11
5.5.10.0070.08320.04
5.5.00.0030.07320.03
5.4.450.0170.08719.45
5.4.440.0030.04719.43
5.4.430.0070.07019.45
5.4.420.0070.07019.45
5.4.410.0070.07019.33
5.4.400.0100.06019.13
5.4.390.0030.05318.85
5.4.380.0030.07019.04
5.4.370.0070.04019.25
5.4.360.0200.06019.21
5.4.350.0030.07318.85
5.4.340.0000.06718.94
5.4.320.0030.06019.25
5.4.310.0100.07319.12
5.4.300.0170.06018.90
5.4.290.0030.06719.04
5.4.280.0000.05318.94
5.4.270.0130.06718.84
5.4.260.0070.06719.12
5.4.250.0100.07019.02
5.4.240.0070.07019.12
5.4.230.0130.07319.02
5.4.220.0130.04319.23
5.4.210.0130.05019.04
5.4.200.0170.04318.87
5.4.190.0130.08719.20
5.4.180.0070.07018.87
5.4.170.0130.03718.89
5.4.160.0100.05719.20
5.4.150.0070.07719.07
5.4.140.0130.08016.47
5.4.130.0130.06716.29
5.4.120.0130.06016.38
5.4.110.0070.07316.39
5.4.100.0070.04016.27
5.4.90.0070.03716.39
5.4.80.0030.07016.34
5.4.70.0100.04316.41
5.4.60.0070.04016.29
5.4.50.0130.06316.32
5.4.40.0100.06316.42
5.4.30.0100.07316.41
5.4.20.0100.05016.44
5.4.10.0170.06716.43
5.4.00.0030.06015.80
5.3.290.0100.07314.60
5.3.280.0070.06714.72
5.3.270.0170.08314.70
5.3.260.0070.04314.57
5.3.250.0030.04314.68
5.3.240.0000.06014.59
5.3.230.0100.07714.62
5.3.220.0130.06714.71
5.3.210.0130.07314.50
5.3.200.0030.07314.58
5.3.190.0030.08314.63
5.3.180.0130.06714.59
5.3.170.0070.06314.63
5.3.160.0070.07014.58
5.3.150.0100.05714.50
5.3.140.0000.04314.54
5.3.130.0070.08014.55
5.3.120.0130.07014.57
5.3.110.0070.03714.59
5.3.100.0130.07314.14
5.3.90.0100.07014.08
5.3.80.0070.06314.11
5.3.70.0070.04013.93
5.3.60.0030.04714.15
5.3.50.0030.07714.08
5.3.40.0030.04713.97
5.3.30.0130.06313.92
5.3.20.0070.06713.71
5.3.10.0100.07313.75
5.3.00.0130.06313.69
5.2.170.0030.03711.15
5.2.160.0070.03011.06
5.2.150.0100.06011.18
5.2.140.0100.05711.26
5.2.130.0000.06311.24
5.2.120.0070.06011.01
5.2.110.0030.06311.17
5.2.100.0030.06310.96
5.2.90.0030.03311.11
5.2.80.0070.06711.15
5.2.70.0070.04011.13
5.2.60.0130.05711.19
5.2.50.0100.05311.08
5.2.40.0000.03310.90
5.2.30.0070.03710.84
5.2.20.0070.05710.88
5.2.10.0070.05710.81
5.2.00.0070.06010.73
5.1.60.0070.0479.90
5.1.50.0030.04310.04
5.1.40.0030.05310.05
5.1.30.0070.04710.40
5.1.20.0030.04010.38
5.1.10.0000.05010.06
5.1.00.0070.05310.14
5.0.50.0000.0408.66
5.0.40.0070.0438.45
5.0.30.0030.0478.40
5.0.20.0000.0478.40
5.0.10.0030.0238.40
5.0.00.0030.0638.40
4.4.90.0030.0338.40
4.4.80.0130.0238.40
4.4.70.0030.0278.40
4.4.60.0030.0238.40
4.4.50.0030.0378.40
4.4.40.0070.0508.40
4.4.30.0030.0338.40
4.4.20.0070.0338.40
4.4.10.0000.0278.40
4.4.00.0030.0538.40
4.3.110.0070.0338.40
4.3.100.0030.0238.40
4.3.90.0030.0308.40
4.3.80.0030.0238.40
4.3.70.0030.0238.40
4.3.60.0000.0208.40
4.3.50.0030.0308.40
4.3.40.0030.0408.40
4.3.30.0000.0238.40
4.3.20.0000.0408.40
4.3.10.0030.0238.40
4.3.00.0000.0308.40

preferences:
62.63 ms | 401 KiB | 5 Q