3v4l.org

run code in 300+ PHP versions simultaneously
<?php function isArrayFieldSet(array $array, $field, $separator = '/') { if (strpos($field, $separator) !== false) { $path = explode($separator, $field); $field = array_shift($path); if (!is_null($field) && isset($array[$field])) { if (count($path) > 0) { return isArrayFieldSet($array[$field], implode($separator, $path), $separator); } return true; } else { return false; } } return isset($array[$field]); } $array = [ 'a' => 'test', 'b' => [ 'b2' => 123, 'b3' => [ 'test' => true ] ] ]; $shouldPass = [ 'a', 'b', 'b/b2', 'b/b3', 'b/b3/test' ]; $shouldNotPass = [ 'c', 'b/b1', 'b/b2/bx', 'b/b3/test/x', 'c/L1', 'a/k15', ]; for ($i = 0; $i < 100; $i++) { foreach ($shouldPass as $test) { isArrayFieldSet($array, $test, '/'); } foreach ($shouldNotPass as $test) { isArrayFieldSet($array, $test, '/'); } }

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.0060.00916.63
8.3.60.0000.01516.62
8.3.50.0200.00422.03
8.3.40.0120.00318.75
8.3.30.0070.00718.84
8.3.20.0000.00820.35
8.3.10.0040.00423.59
8.3.00.0040.00419.41
8.2.190.0080.00816.58
8.2.180.0080.00817.00
8.2.170.0090.00622.96
8.2.160.0100.00320.35
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0030.00617.75
8.2.120.0030.00626.35
8.2.110.0000.00920.52
8.2.100.0150.00018.04
8.2.90.0040.00419.40
8.2.80.0040.00417.97
8.2.70.0050.00317.71
8.2.60.0000.00818.05
8.2.50.0000.00818.07
8.2.40.0000.00819.26
8.2.30.0000.00720.70
8.2.20.0060.00317.73
8.2.10.0000.00818.07
8.2.00.0000.00718.07
8.1.280.0150.00025.92
8.1.270.0000.01023.96
8.1.260.0040.00428.09
8.1.250.0060.00328.09
8.1.240.0040.01222.23
8.1.230.0080.00417.65
8.1.220.0080.00017.74
8.1.210.0030.00618.77
8.1.200.0040.00417.12
8.1.190.0050.00317.35
8.1.180.0060.00318.10
8.1.170.0040.00418.76
8.1.160.0050.00322.09
8.1.150.0000.00718.86
8.1.140.0090.00319.74
8.1.130.0080.00017.76
8.1.120.0040.00417.49
8.1.110.0000.00817.41
8.1.100.0000.00717.38
8.1.90.0000.00817.55
8.1.80.0060.00317.47
8.1.70.0040.00417.38
8.1.60.0040.00417.65
8.1.50.0050.00317.52
8.1.40.0050.00317.43
8.1.30.0030.00517.69
8.1.20.0000.00917.54
8.1.10.0030.00517.61
8.1.00.0060.00317.55
8.0.300.0070.00018.77
8.0.290.0000.00716.88
8.0.280.0030.00318.43
8.0.270.0000.00717.30
8.0.260.0000.00617.31
8.0.250.0070.00017.07
8.0.240.0000.00717.02
8.0.230.0040.00417.05
8.0.220.0000.00716.98
8.0.210.0040.00317.06
8.0.200.0030.00316.97
8.0.190.0040.00417.10
8.0.180.0050.00317.00
8.0.170.0050.00316.98
8.0.160.0000.00716.98
8.0.150.0040.00416.89
8.0.140.0000.00816.76
8.0.130.0000.00613.46
8.0.120.0080.00016.88
8.0.110.0050.00317.05
8.0.100.0000.00717.01
8.0.90.0050.00316.95
8.0.80.0130.00916.99
8.0.70.0040.00416.83
8.0.60.0080.00016.81
8.0.50.0030.00616.98
8.0.30.0040.01617.06
8.0.20.0130.00617.40
8.0.10.0100.00017.09
8.0.00.0080.00916.71
7.4.330.0000.00516.73
7.4.320.0030.00316.57
7.4.300.0030.00316.53
7.4.290.0000.00716.53
7.4.280.0030.00516.53
7.4.270.0030.00316.48
7.4.260.0040.00416.47
7.4.250.0040.00416.49
7.4.240.0010.00616.56
7.4.230.0040.00416.71
7.4.220.0060.01216.51
7.4.210.0060.00916.54
7.4.200.0000.00716.48
7.4.160.0070.01016.55
7.4.150.0110.00617.40
7.4.140.0120.00617.86
7.4.130.0090.00916.68
7.4.120.0080.01016.55
7.4.110.0140.00516.73
7.4.100.0150.00616.63
7.4.90.0140.00316.61
7.4.80.0080.01619.39
7.4.70.0110.00816.61
7.4.60.0100.00716.53
7.4.50.0060.00916.43
7.4.40.0160.00316.50
7.4.30.0070.01116.57
7.4.10.0080.00816.68
7.4.00.0060.00915.73
7.3.330.0030.00313.29
7.3.320.0060.00013.39
7.3.310.0040.00416.33
7.3.300.0000.00716.50
7.3.290.0040.01016.46
7.3.280.0100.01016.46
7.3.270.0070.01117.40
7.3.260.0160.00016.43
7.3.250.0120.00716.50
7.3.240.0100.00716.51
7.3.230.0000.01716.44
7.3.210.0100.00616.68
7.3.200.0090.00916.40
7.3.190.0100.01016.70
7.3.180.0070.01016.54
7.3.170.0100.00716.66
7.3.160.0070.01316.46
7.3.130.0000.01816.41
7.3.120.0130.00716.56
7.3.110.0070.00716.49
7.3.100.0030.01616.58
7.3.90.0110.00716.46
7.3.80.0040.00716.41
7.3.70.0130.00316.32
7.3.60.0060.00916.48
7.3.50.0060.00616.45
7.3.40.0130.00016.20
7.3.30.0040.01116.37
7.3.20.0070.00718.29
7.3.10.0070.00718.23
7.3.00.0080.00817.48
7.2.330.0080.00816.77
7.2.320.0070.01116.75
7.2.310.0130.00416.84
7.2.300.0060.01216.81
7.2.290.0130.00616.71
7.2.260.0130.00716.66
7.2.250.0100.01316.84
7.2.240.0090.00316.58
7.2.230.0000.01916.78
7.2.220.0000.01716.70
7.2.210.0030.01216.66
7.2.200.0120.00416.67
7.2.190.0090.00416.54
7.2.180.0140.00316.76
7.2.170.0070.00716.58
7.2.160.0090.00616.57
7.2.150.0000.01318.35
7.2.140.0100.00718.45
7.2.130.0080.00317.77
7.2.120.0100.00517.71
7.2.110.0070.00717.51
7.2.100.0100.00217.73
7.2.90.0060.00917.69
7.2.80.0080.00617.59
7.2.70.0040.00817.48
7.2.60.0030.01017.53
7.2.50.0050.00917.71
7.2.40.0100.00617.76
7.2.30.0020.01217.73
7.2.20.0060.00817.59
7.2.10.0060.00817.69
7.2.00.0090.00517.63
7.1.330.0070.01017.54
7.1.320.0000.01817.24
7.1.310.0060.00617.37
7.1.300.0060.00917.54
7.1.290.0030.00617.39
7.1.280.0070.00717.32
7.1.270.0060.00317.40
7.1.260.0000.01117.28
7.1.250.0030.00816.67
7.1.240.0070.00516.61
7.1.230.0080.00316.61
7.1.220.0050.00516.52
7.1.210.0040.00916.42
7.1.200.0080.00616.33
7.1.190.0020.01116.62
7.1.180.0020.01016.66
7.1.170.0030.00916.44
7.1.160.0060.00816.63
7.1.150.0080.00416.45
7.1.140.0030.01216.59
7.1.130.0070.00516.60
7.1.120.0060.00616.62
7.1.110.0050.00916.59
7.1.100.0030.00817.09
7.1.90.0030.01116.62
7.1.80.0090.00516.57
7.1.70.0050.00416.85
7.1.60.0080.00617.47
7.1.50.0060.00816.69
7.1.40.0070.00616.51
7.1.30.0070.00516.69
7.1.20.0050.00816.55
7.1.10.0020.01016.61
7.1.00.0040.03118.55
7.0.330.0020.00916.28
7.0.320.0050.01116.17
7.0.310.0060.00216.18
7.0.300.0060.00816.20
7.0.290.0080.00515.97
7.0.280.0050.00716.13
7.0.270.0050.01016.32
7.0.260.0100.00316.10
7.0.250.0040.00916.24
7.0.240.0060.00616.33
7.0.230.0100.00316.21
7.0.220.0080.00516.29
7.0.210.0020.01116.29
7.0.200.0030.00616.39
7.0.190.0030.01016.25
7.0.180.0040.00916.16
7.0.170.0050.00916.15
7.0.160.0050.01016.16
7.0.150.0080.00716.07
7.0.140.0020.01116.15
7.0.130.0090.00616.21
7.0.120.0070.00416.30
7.0.110.0100.00816.21
7.0.100.0080.00616.14
7.0.90.0050.00616.17
7.0.80.0050.00816.25
7.0.70.0060.00616.15
7.0.60.0080.03117.40
7.0.50.0040.03316.77
7.0.40.0040.02816.26
7.0.30.0130.03016.20
7.0.20.0180.02816.10
7.0.10.0110.02916.16
7.0.00.0110.01216.19
5.6.400.0060.00616.15
5.6.390.0100.00315.70
5.6.380.0030.00815.35
5.6.370.0030.01215.06
5.6.360.0020.01015.12
5.6.350.0030.00615.29
5.6.340.0070.00615.32
5.6.330.0110.00015.20
5.6.320.0030.00815.33
5.6.310.0050.00815.47
5.6.300.0050.00615.32
5.6.290.0080.00415.41
5.6.280.0060.00715.42
5.6.270.0040.00715.05
5.6.260.0070.00915.22
5.6.250.0070.00515.14
5.6.240.0050.00915.15
5.6.230.0050.01115.28
5.6.220.0050.00815.09
5.6.210.0040.02816.95
5.6.200.0060.02116.08
5.6.190.0050.03716.98
5.6.180.0110.02317.25
5.6.170.0080.03617.07
5.6.160.0080.03316.87
5.6.150.0080.02916.08
5.6.140.0060.01816.09
5.6.130.0060.02116.23
5.6.120.0070.02717.04
5.6.110.0070.02217.07
5.6.100.0110.02817.16
5.6.90.0090.02817.07
5.6.80.0090.02016.88
5.6.70.0030.01215.12
5.6.60.0050.00715.13
5.6.50.0030.01115.15
5.6.40.0040.00815.00
5.6.30.0020.00915.08
5.6.20.0100.00515.16
5.6.10.0090.00615.25
5.6.00.0050.00615.02
5.5.380.0020.01113.68
5.5.370.0010.01313.86
5.5.360.0020.00813.46
5.5.350.0120.02715.81
5.5.340.0080.02915.11
5.5.330.0030.02115.89
5.5.320.0050.02815.89
5.5.310.0120.02315.76
5.5.300.0080.01815.07
5.5.290.0080.02915.03
5.5.280.0040.02616.10
5.5.270.0070.03216.01
5.5.260.0060.01616.03
5.5.250.0050.03215.93
5.5.240.0120.02915.72
5.5.230.0070.00813.52
5.5.220.0060.00513.45
5.5.210.0040.00613.50
5.5.200.0050.00813.49
5.5.190.0030.00713.52
5.5.180.0060.00413.44
5.5.170.0050.00413.51
5.5.160.0030.01013.43
5.5.150.0070.00513.57
5.5.140.0040.01013.61
5.5.130.0070.00513.67
5.5.120.0000.01013.67
5.5.110.0080.00313.54
5.5.100.0030.00813.64
5.5.90.0060.00413.63
5.5.80.0050.00513.49
5.5.70.0060.00613.46
5.5.60.0000.01113.49
5.5.50.0070.00513.55
5.5.40.0100.00313.59
5.5.30.0050.00413.44
5.5.20.0080.00413.43
5.5.10.0060.00813.48
5.5.00.0000.00813.55

preferences:
51.1 ms | 401 KiB | 5 Q