3v4l.org

run code in 300+ PHP versions simultaneously
<?php function flatCall($data_arr, $data_arr_call){ $current = $data_arr; foreach($data_arr_call as $key){ $current = $current[$key]; } return $current; } $MAP = array("profile" => array("setting" => array("test" => array("idknow" => "someValue")))); $urlString = "www.example.com/profile/setting/test/idknow"; $URL = explode("/", $urlString); //split URL string into an array array_shift($URL); //remove first element $result = flatCall($MAP, $URL); echo $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.4.140.0090.01317.39
8.4.130.0040.00718.73
8.4.120.0010.00724.02
8.4.110.0110.01022.43
8.4.100.0120.00818.63
8.4.90.0110.00922.03
8.4.80.0100.01118.65
8.4.70.0080.00118.96
8.4.60.0130.00818.70
8.4.50.0150.00417.55
8.4.40.0060.01318.09
8.4.30.0120.00620.85
8.4.20.0160.00317.75
8.4.10.0040.00722.12
8.3.270.0110.00916.52
8.3.260.0140.00616.63
8.3.250.0090.00918.96
8.3.240.0100.00917.17
8.3.230.0120.00716.60
8.3.220.0100.00718.94
8.3.210.0070.01218.45
8.3.200.0070.00216.40
8.3.190.0080.01016.98
8.3.180.0060.00216.36
8.3.170.0000.00819.19
8.3.160.0090.00918.28
8.3.150.0090.00918.70
8.3.140.0070.00716.54
8.3.130.0060.00318.31
8.3.120.0130.00620.66
8.3.110.0080.00016.53
8.3.100.0060.00316.66
8.3.90.0110.00326.77
8.3.80.0140.00016.38
8.3.70.0120.00616.63
8.3.60.0180.00318.15
8.3.50.0120.00320.12
8.3.40.0000.01420.38
8.3.30.0090.00618.61
8.3.20.0060.00324.18
8.3.10.0040.00424.66
8.3.00.0060.00326.16
8.2.290.0110.00820.49
8.2.280.0110.00818.34
8.2.270.0090.00616.95
8.2.260.0030.00518.87
8.2.250.0070.01316.56
8.2.240.0000.00918.64
8.2.230.0080.00020.94
8.2.220.0080.00024.06
8.2.210.0040.00426.77
8.2.200.0070.00316.63
8.2.190.0070.00716.63
8.2.180.0060.00925.92
8.2.170.0110.00622.96
8.2.160.0110.00322.96
8.2.150.0040.00425.66
8.2.140.0080.00024.66
8.2.130.0030.00626.16
8.2.120.0000.00826.16
8.2.110.0030.00620.47
8.2.100.0040.00817.91
8.2.90.0060.00317.75
8.2.80.0000.00817.97
8.2.70.0040.00417.63
8.2.60.0060.00317.50
8.2.50.0080.00018.05
8.2.40.0050.00318.22
8.2.30.0050.00218.14
8.2.20.0040.00419.32
8.2.10.0090.00018.21
8.2.00.0040.00419.40
8.1.330.0110.00721.96
8.1.320.0130.00622.05
8.1.310.0120.00616.55
8.1.300.0060.00318.41
8.1.290.0060.00330.84
8.1.280.0100.00625.92
8.1.270.0030.00624.66
8.1.260.0040.00426.35
8.1.250.0000.00728.09
8.1.240.0030.00623.73
8.1.230.0070.00420.93
8.1.220.0030.00617.79
8.1.210.0050.00318.77
8.1.200.0090.00017.36
8.1.190.0050.00317.23
8.1.180.0050.00518.10
8.1.170.0030.00517.62
8.1.160.0000.00719.04
8.1.150.0060.00318.64
8.1.140.0040.00417.58
8.1.130.0000.00719.02
8.1.120.0000.00717.39
8.1.110.0170.00017.46
8.1.100.0070.01017.37
8.1.90.0130.00317.38
8.1.80.0160.00017.54
8.1.70.0120.00517.38
8.1.60.0150.00417.63
8.1.50.0150.00317.57
8.1.40.0160.00317.52
8.1.30.0110.00617.65
8.1.20.0140.00617.54
8.1.10.0170.00517.54
8.1.00.0160.00017.52
8.0.300.0040.00419.98
8.0.290.0090.00016.63
8.0.280.0000.01018.46
8.0.270.0040.00217.23
8.0.260.0000.00818.48
8.0.250.0000.00716.91
8.0.240.0000.00716.84
8.0.230.0070.01016.92
8.0.220.0050.01116.81
8.0.210.0100.00516.89
8.0.200.0100.00716.92
8.0.190.0130.00316.97
8.0.180.0080.00816.78
8.0.170.0150.00016.91
8.0.160.0140.00316.86
8.0.150.0130.00316.66
8.0.140.0110.00416.83
8.0.130.0100.00716.84
8.0.120.0110.00516.93
8.0.110.0090.00616.92
8.0.100.0120.00416.76
8.0.90.0060.00916.91
8.0.80.0160.00016.91
8.0.70.0130.00416.76
8.0.60.0180.00016.91
8.0.50.0120.00516.69
8.0.30.0070.00816.73
8.0.20.0120.00416.99
8.0.10.0110.00716.88
7.4.330.0000.00515.55
7.4.320.0160.00316.50
7.4.300.0090.00916.51
7.4.290.0170.00016.62
7.4.280.0160.00316.46
7.4.270.0140.00316.41
7.4.260.0110.00816.61
7.4.250.0140.00516.54
7.4.240.0150.00016.58
7.4.230.0120.00216.58
7.4.220.0160.00016.46
7.4.210.0060.00616.62
7.4.200.0090.00516.56
7.4.190.0100.00016.65
7.4.180.0100.00316.56
7.4.160.0090.00716.68
7.4.150.0090.00316.42
7.4.140.0100.00516.60
7.4.130.0040.00916.39
7.4.120.0030.00916.37
7.4.110.0130.00016.33
7.4.100.0120.00316.59
7.4.90.0140.00216.45
7.4.80.0130.00416.37
7.4.70.0110.00416.46
7.4.60.0120.00316.45
7.4.50.0110.00416.51
7.4.40.0130.00316.39
7.4.30.0090.00416.45
7.4.20.0100.00516.54
7.4.10.0030.01016.43
7.4.00.0050.00816.41

preferences:
37.05 ms | 403 KiB | 5 Q