3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getValue($testArray, $exploded, $index) { if(is_array($testArray[$exploded[$index]])) { return getValue($testArray[$exploded[$index]], $exploded, $index++); } else { return $testArray[$exploded[$index]]; } } $string = 'router.format'; $testArray = array( 'router' => array( 'format' => 'xml', ), ); $exploded = explode(".", $string); /*if(count($exploded) != count($testArray)) { throw new Exception("mismatch"); }*/ $desiredValue = getValue($testArray, $exploded, 0); print_r($desiredValue);

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.0070.00718.42
8.3.60.0090.01218.40
8.3.50.0220.00822.11
8.3.40.0030.01718.84
8.3.30.0100.00719.21
8.3.20.0060.00320.33
8.3.10.0050.00521.81
8.3.00.0030.00617.93
8.2.180.0160.00616.74
8.2.170.0070.00722.96
8.2.160.0100.01020.44
8.2.150.0040.00424.18
8.2.140.0070.00024.66
8.2.130.0140.00326.16
8.2.120.0080.00021.09
8.2.110.0050.00520.52
8.2.100.0080.00418.04
8.2.90.0000.00918.16
8.2.80.0030.00517.97
8.2.70.0080.00017.63
8.2.60.0090.00317.66
8.2.50.0000.00818.07
8.2.40.0040.00420.07
8.2.30.0000.01017.99
8.2.20.0000.00817.76
8.2.10.0080.00018.13
8.2.00.0070.00017.66
8.1.280.0110.00425.92
8.1.270.0050.00322.06
8.1.260.0070.00026.35
8.1.250.0040.01228.09
8.1.240.0000.00922.14
8.1.230.0080.00320.97
8.1.220.0000.00817.74
8.1.210.0060.00318.89
8.1.200.0060.00317.23
8.1.190.0110.00017.10
8.1.180.0000.00818.10
8.1.170.0000.00818.50
8.1.160.0070.00021.94
8.1.150.0030.00518.85
8.1.140.0040.00417.30
8.1.130.0070.00017.71
8.1.120.0040.00417.34
8.1.110.0080.00017.34
8.1.100.0050.00217.41
8.1.90.0070.00017.45
8.1.80.0000.00817.44
8.1.70.0000.00717.30
8.1.60.0080.00017.52
8.1.50.0040.00417.38
8.1.40.0030.00617.55
8.1.30.0000.00817.54
8.1.20.0040.00417.68
8.1.10.0000.00717.42
8.1.00.0000.00817.42
8.0.300.0030.00520.04
8.0.290.0070.00016.63
8.0.280.0000.00718.43
8.0.270.0000.00717.24
8.0.260.0000.00617.27
8.0.250.0000.00716.95
8.0.240.0000.00716.98
8.0.230.0030.00316.98
8.0.220.0050.00216.93
8.0.210.0000.00716.88
8.0.200.0030.00317.00
8.0.190.0050.00216.98
8.0.180.0000.00716.95
8.0.170.0030.00516.92
8.0.160.0000.00716.98
8.0.150.0030.00316.84
8.0.140.0000.00916.80
8.0.130.0000.00713.34
8.0.120.0040.00416.79
8.0.110.0000.00716.80
8.0.100.0040.00416.82
8.0.90.0030.00316.86
8.0.80.0060.00916.89
8.0.70.0040.00416.86
8.0.60.0000.00816.89
8.0.50.0050.00316.72
8.0.30.0090.01116.95
8.0.20.0090.00917.40
8.0.10.0050.00316.90
8.0.00.0070.01016.77
7.4.330.0030.00315.00
7.4.320.0000.00616.47
7.4.300.0030.00316.48
7.4.290.0070.00016.50
7.4.280.0040.00416.46
7.4.270.0030.00316.42
7.4.260.0030.00316.49
7.4.250.0050.00216.40
7.4.240.0000.00716.47
7.4.230.0030.00316.69
7.4.220.0120.00616.67
7.4.210.0080.00516.47
7.4.200.0000.00816.41
7.4.160.0100.00716.51
7.4.150.0100.01017.40
7.4.140.0090.00817.86
7.4.130.0060.01116.52
7.4.120.0080.01016.55
7.4.110.0120.00916.42
7.4.100.0090.00916.46
7.4.90.0130.00316.48
7.4.80.0090.00919.39
7.4.70.0120.00616.49
7.4.60.0070.01016.52
7.4.50.0020.00216.45
7.4.40.0140.00716.43
7.4.30.0090.00616.53
7.4.00.0040.01115.00
7.3.330.0000.00613.38
7.3.320.0050.00013.38
7.3.310.0070.00016.22
7.3.300.0000.00716.44
7.3.290.0000.01416.43
7.3.280.0070.01016.40
7.3.270.0090.00917.40
7.3.260.0100.00716.21
7.3.250.0120.01116.49
7.3.240.0030.01316.56
7.3.230.0070.01016.39
7.3.210.0070.01316.43
7.3.200.0160.03219.39
7.3.190.0080.00816.65
7.3.180.0080.01216.39
7.3.170.0120.00416.29
7.3.160.0090.00616.41
7.3.120.0070.00714.85
7.2.330.0100.00716.61
7.2.320.0100.00716.79
7.2.310.0110.00516.44
7.2.300.0030.01316.66
7.2.290.0150.00716.45
7.1.70.0210.00717.16
7.1.60.0120.01219.25
7.1.50.0130.01016.69
7.1.00.0000.08022.48
7.0.200.0070.01016.88
7.0.140.0030.07321.92
7.0.60.0030.07719.89
7.0.50.0070.07017.85
7.0.40.0130.04020.20
7.0.30.0200.05020.26
7.0.20.0370.07320.33
7.0.10.0200.07720.25
7.0.00.0070.09020.22
5.6.280.0030.07321.00
5.6.210.0070.08720.48
5.6.200.0130.06018.18
5.6.190.0100.03720.63
5.6.180.0230.08020.33
5.6.170.0230.05320.52
5.6.160.0000.04720.54
5.6.150.0130.07318.26
5.6.140.0170.07018.24
5.6.130.0070.06018.15
5.6.120.0170.04720.99
5.6.110.0100.08020.98
5.6.100.0070.07020.98
5.6.90.0130.08020.97
5.6.80.0170.07020.52
5.5.350.0270.04720.38
5.5.340.0230.05017.98
5.5.330.0070.08720.19
5.5.320.0300.06320.36
5.5.310.0270.07020.27
5.5.300.0030.07018.08
5.5.290.0100.06018.03
5.5.280.0100.08020.88
5.5.270.0030.06320.89
5.5.260.0030.07720.73
5.5.250.0130.06720.66
5.5.240.0000.05320.16
5.4.450.0330.07019.42
5.4.440.0300.07019.21
5.4.430.0370.05319.48
5.4.420.0270.04719.54
5.4.410.0270.07319.26
5.4.400.0400.06019.14
5.4.390.0330.07319.25
5.4.380.0270.07719.15
5.4.370.0400.06019.09
5.4.360.0270.05319.23
5.4.350.0300.05718.87
5.4.340.0270.07319.13
5.4.320.0300.06719.31
5.4.310.0400.06018.94
5.4.300.0300.04319.15
5.4.290.0300.06719.14
5.4.280.0300.03319.21
5.4.270.0330.07019.08
5.4.260.0330.05718.98
5.4.250.0300.06719.31
5.4.240.0300.04319.05
5.4.230.0300.05719.05
5.4.220.0270.04318.95
5.4.210.0230.07718.97
5.4.200.0270.06318.81
5.4.190.0400.04319.05
5.4.180.0300.04319.22
5.4.170.0270.04319.05
5.4.160.0300.07019.14
5.4.150.0330.03719.06
5.4.140.0330.06716.36
5.4.130.0300.06316.41
5.4.120.0300.05316.33
5.4.110.0230.04716.45
5.4.100.0330.06716.45
5.4.90.0400.05716.19
5.4.80.0270.04716.45
5.4.70.0330.06016.40
5.4.60.0370.05316.43
5.4.50.0230.04716.33
5.4.40.0270.05316.16
5.4.30.0300.04016.55
5.4.20.0370.05716.56
5.4.10.0330.03316.16
5.4.00.0230.03715.88
5.3.290.0300.05014.74
5.3.280.0370.06314.71
5.3.270.0270.04014.57
5.3.260.0330.07014.66
5.3.250.0370.06314.76
5.3.240.0400.07014.82
5.3.230.0300.07014.61
5.3.220.0330.03714.65
5.3.210.0230.03714.64
5.3.200.0230.04014.46
5.3.190.0330.04014.78
5.3.180.0270.07014.46
5.3.170.0330.05314.58
5.3.160.0300.07314.69
5.3.150.0300.06314.55
5.3.140.0370.03714.47
5.3.130.0330.06714.77
5.3.120.0300.06714.77
5.3.110.0430.05714.52
5.3.100.0230.07014.19
5.3.90.0300.06013.95
5.3.80.0270.07713.93
5.3.70.0270.07013.93
5.3.60.0300.06014.08
5.3.50.0270.05314.06
5.3.40.0300.05713.97
5.3.30.0330.06013.88
5.3.20.0330.07013.62
5.3.10.0370.05013.74
5.3.00.0330.06313.69
5.2.170.0270.03012.72
5.2.160.0300.05712.72
5.2.150.0300.06012.72
5.2.140.0300.05012.72
5.2.130.0200.03312.72
5.2.120.0370.03712.72
5.2.110.0230.02712.72
5.2.100.0270.04712.72
5.2.90.0300.05312.72
5.2.80.0300.05012.72
5.2.70.0230.03712.72
5.2.60.0300.05712.72
5.2.50.0230.04712.72
5.2.40.0200.05712.72
5.2.30.0230.05712.72
5.2.20.0270.04012.72
5.2.10.0170.06312.72
5.2.00.0230.03712.72
5.1.60.0200.04712.72
5.1.50.0130.03712.72
5.1.40.0170.03012.72
5.1.30.0230.05312.72
5.1.20.0270.05012.72
5.1.10.0270.02012.72
5.1.00.0130.03012.72
5.0.50.0100.05012.72
5.0.40.0130.03012.72
5.0.30.0100.05312.72
5.0.20.0100.02312.72
5.0.10.0100.03012.72
5.0.00.0170.05012.72
4.4.90.0030.02012.72
4.4.80.0130.03012.72
4.4.70.0100.03712.72
4.4.60.0130.03012.72
4.4.50.0070.02712.72
4.4.40.0100.05312.72
4.4.30.0100.01712.72
4.4.20.0070.02712.72
4.4.10.0070.02312.72
4.4.00.0170.04312.72
4.3.110.0070.03312.72
4.3.100.0100.02012.72
4.3.90.0100.02012.72
4.3.80.0100.03012.72
4.3.70.0130.02712.72
4.3.60.0170.02012.72
4.3.50.0100.03012.72
4.3.40.0130.04012.72
4.3.30.0030.03712.72
4.3.20.0100.03312.72
4.3.10.0070.02312.72
4.3.00.0030.02712.72

preferences:
61.18 ms | 401 KiB | 5 Q