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 $this->isArrayFieldSet($array[], 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', ]; 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.60.0100.00316.75
8.3.50.0100.00821.98
8.3.40.0040.01118.74
8.3.30.0090.00618.83
8.3.20.0040.00420.07
8.3.10.0030.00623.47
8.3.00.0040.00419.38
8.2.180.0150.00617.00
8.2.170.0070.00722.96
8.2.160.0110.00720.44
8.2.150.0000.00824.18
8.2.140.0040.00424.66
8.2.130.0070.00317.75
8.2.120.0070.00026.35
8.2.110.0100.00020.93
8.2.100.0040.00818.03
8.2.90.0040.00419.17
8.2.80.0080.00017.97
8.2.70.0000.00817.63
8.2.60.0040.00417.90
8.2.50.0030.00718.07
8.2.40.0060.00319.38
8.2.30.0070.00020.66
8.2.20.0080.00317.84
8.2.10.0040.00418.13
8.2.00.0040.00418.02
8.1.280.0090.00625.92
8.1.270.0050.00523.98
8.1.260.0030.00528.09
8.1.250.0040.00428.09
8.1.240.0100.00322.00
8.1.230.0080.00322.68
8.1.220.0000.00817.78
8.1.210.0060.00318.77
8.1.200.0030.00617.35
8.1.190.0000.00817.23
8.1.180.0040.00418.10
8.1.170.0060.00318.84
8.1.160.0040.00422.07
8.1.150.0040.00418.96
8.1.140.0070.00319.61
8.1.130.0000.00717.65
8.1.120.0040.00417.52
8.1.110.0000.00817.55
8.1.100.0040.00417.48
8.1.90.0040.00417.45
8.1.80.0070.00017.47
8.1.70.0040.00417.45
8.1.60.0040.00417.68
8.1.50.0050.00317.57
8.1.40.0030.00517.59
8.1.30.0060.00317.71
8.1.20.0000.00717.57
8.1.10.0000.00817.61
8.1.00.0040.00717.54
8.0.300.0080.00018.84
8.0.290.0040.00416.75
8.0.280.0000.00718.39
8.0.270.0000.00817.20
8.0.260.0060.00017.34
8.0.250.0000.00716.95
8.0.240.0030.00317.08
8.0.230.0080.00016.94
8.0.220.0040.00416.98
8.0.210.0000.00716.98
8.0.200.0000.00817.05
8.0.190.0050.00217.09
8.0.180.0000.00817.05
8.0.170.0000.00717.00
8.0.160.0040.00416.96
8.0.150.0070.00017.05
8.0.140.0000.00816.85
8.0.130.0000.00713.41
8.0.120.0000.00716.92
8.0.110.0050.00216.82
8.0.100.0000.00716.77
8.0.90.0070.00016.88
8.0.80.0120.00916.96
8.0.70.0040.00416.88
8.0.60.0040.00416.88
8.0.50.0070.00016.84
8.0.30.0080.01017.13
8.0.20.0150.00717.41
8.0.10.0040.00417.05
8.0.00.0070.01116.82
7.4.330.0050.00016.84
7.4.320.0000.00716.53
7.4.300.0030.00316.55
7.4.290.0030.00316.52
7.4.280.0040.00416.62
7.4.270.0030.00316.69
7.4.260.0070.00016.54
7.4.250.0000.00716.50
7.4.240.0040.00316.54
7.4.230.0000.00716.66
7.4.220.0120.00616.70
7.4.210.0150.00016.63
7.4.200.0070.00016.75
7.4.160.0090.00616.68
7.4.150.0110.00717.40
7.4.140.0040.01417.86
7.4.130.0110.00916.61
7.4.120.0040.01216.58
7.4.110.0130.00616.48
7.4.100.0100.00716.50
7.4.90.0070.01016.60
7.4.80.0090.00619.39
7.4.70.0060.01116.52
7.4.60.0070.01016.70
7.4.50.0090.00916.17
7.4.40.0140.00316.49
7.4.30.0120.00916.61
7.4.10.0090.01115.67
7.4.00.0040.01215.43
7.3.330.0070.00013.23
7.3.320.0000.00513.27
7.3.310.0000.00816.44
7.3.300.0000.00716.45
7.3.290.0080.00616.40
7.3.280.0220.00216.44
7.3.270.0090.00917.40
7.3.260.0110.00616.56
7.3.250.0100.00716.47
7.3.240.0100.00816.49
7.3.230.0130.00416.43
7.3.210.0190.00416.66
7.3.200.0090.00916.38
7.3.190.0110.00716.69
7.3.180.0100.00716.31
7.3.170.0060.01016.50
7.3.160.0100.01316.47
7.3.130.0090.00815.64
7.3.120.0090.00815.85
7.3.110.0080.01015.76
7.3.100.0080.00615.71
7.3.90.0080.00815.61
7.3.80.0020.00915.77
7.3.70.0060.00615.47
7.3.60.0130.00415.55
7.3.50.0030.01015.66
7.3.40.0030.01015.77
7.3.30.0090.00315.53
7.3.20.0030.00917.52
7.3.10.0100.00716.97
7.3.00.0080.00917.04
7.2.330.0110.00716.48
7.2.320.0180.00616.82
7.2.310.0100.00716.74
7.2.300.0030.01616.67
7.2.290.0120.00616.37
7.2.260.0060.00915.94
7.2.250.0050.01515.87
7.2.240.0050.01215.86
7.2.230.0080.00815.97
7.2.220.0050.01015.89
7.2.210.0030.00615.91
7.2.200.0050.01115.90
7.2.190.0030.01015.73
7.2.180.0080.00815.87
7.2.170.0070.00915.78
7.2.160.0050.01115.81
7.2.150.0050.01017.63
7.2.140.0060.00817.73
7.2.130.0100.00717.07
7.2.120.0100.00817.13
7.2.110.0070.01016.93
7.2.100.0110.00817.03
7.2.90.0120.00717.06
7.2.80.0120.00817.05
7.2.70.0060.01117.16
7.2.60.0090.01017.01
7.2.50.0070.00917.16
7.2.40.0110.00617.18
7.2.30.0070.00717.02
7.2.20.0100.00617.03
7.2.10.0090.00817.23
7.2.00.0060.00917.70
7.1.330.0040.00916.43
7.1.320.0030.01016.69
7.1.310.0040.01316.52
7.1.300.0020.01216.57
7.1.290.0030.00916.62
7.1.280.0070.00516.57
7.1.270.0040.01016.51
7.1.260.0050.00816.68
7.1.250.0080.00416.06
7.1.240.0080.00816.58
7.1.230.0100.00716.65
7.1.220.0080.00316.65
7.1.210.0040.00816.49
7.1.200.0050.00816.37
7.1.190.0040.00716.48
7.1.180.0070.00716.48
7.1.170.0070.00916.33
7.1.160.0040.00816.55
7.1.150.0040.00816.51
7.1.140.0020.01116.62
7.1.130.0030.00916.43
7.1.120.0060.00516.49
7.1.110.0050.00916.38
7.1.100.0000.01417.06
7.1.90.0050.00716.54
7.1.80.0050.00916.48
7.1.70.0050.00716.68
7.1.60.0080.00817.48
7.1.50.0030.00816.58
7.1.40.0060.00816.45
7.1.30.0030.01116.49
7.1.20.0030.00816.52
7.1.10.0090.00516.61
7.1.00.0050.03018.47
7.0.330.0100.00516.10
7.0.320.0050.00716.33
7.0.310.0070.00616.22
7.0.300.0060.00916.24
7.0.290.0020.00816.18
7.0.280.0040.00916.17
7.0.270.0050.01116.17
7.0.260.0070.00516.28
7.0.250.0080.00516.28
7.0.240.0070.00716.19
7.0.230.0060.00716.28
7.0.220.0070.00716.24
7.0.210.0050.01116.02
7.0.200.0040.00616.33
7.0.190.0060.00616.20
7.0.180.0010.01416.13
7.0.170.0030.01016.24
7.0.160.0030.01016.25
7.0.150.0080.00516.19
7.0.140.0030.01016.28
7.0.130.0080.00616.16
7.0.120.0060.00516.37
7.0.110.0030.01016.19
7.0.100.0070.00916.29
7.0.90.0080.00616.31
7.0.80.0050.00816.27
7.0.70.0040.00716.04
7.0.60.0100.03017.60
7.0.50.0070.03316.76
7.0.40.0030.03016.25
7.0.30.0100.02216.17
7.0.20.0150.02716.17
7.0.10.0060.02516.15
7.0.00.0080.03016.25
5.6.400.0050.00715.12
5.6.390.0060.01015.22
5.6.380.0050.00615.44
5.6.370.0050.00815.18
5.6.360.0080.00815.11
5.6.350.0060.00915.13
5.6.340.0060.00815.22
5.6.330.0050.00915.39
5.6.320.0030.01014.97
5.6.310.0080.00815.13
5.6.300.0080.00814.99
5.6.290.0060.01115.05
5.6.280.0080.00515.14
5.6.270.0050.00915.14
5.6.260.0060.00515.04
5.6.250.0070.00415.04
5.6.240.0050.00715.30
5.6.230.0050.00615.12
5.6.220.0060.00815.19
5.6.210.0130.02616.92
5.6.200.0070.02516.24
5.6.190.0060.01816.90
5.6.180.0140.02916.90
5.6.170.0120.01817.10
5.6.160.0090.03216.85
5.6.150.0060.02116.04
5.6.140.0080.01916.09
5.6.130.0070.03016.08
5.6.120.0050.02517.02
5.6.110.0060.02817.05
5.6.100.0070.03517.19
5.6.90.0090.02317.07
5.6.80.0090.02016.73
5.6.70.0070.00514.76
5.6.60.0010.01014.85
5.6.50.0050.00715.03
5.6.40.0090.00414.97
5.6.30.0050.00714.94
5.6.20.0050.00714.97
5.6.10.0050.00614.97
5.6.00.0030.00815.00
5.5.380.0080.00814.73
5.5.370.0060.00614.81
5.5.360.0040.00714.85
5.5.350.0150.02716.81
5.5.340.0090.01615.95
5.5.330.0080.02216.61
5.5.320.0030.02516.68
5.5.310.0120.02216.71
5.5.300.0090.03015.96
5.5.290.0090.02915.97
5.5.280.0110.02516.90
5.5.270.0090.02116.84
5.5.260.0060.01716.82
5.5.250.0090.02316.93
5.5.240.0190.02316.76
5.5.230.0090.00514.76
5.5.220.0050.01014.98
5.5.210.0040.01014.85
5.5.200.0100.00314.94
5.5.190.0050.01014.71
5.5.180.0040.00914.81
5.5.170.0050.00814.57
5.5.160.0040.00814.90
5.5.150.0070.00714.77
5.5.140.0110.00414.97
5.5.130.0060.00814.96
5.5.120.0090.00814.84
5.5.110.0050.00614.99
5.5.100.0050.00814.86
5.5.90.0050.01014.80
5.5.80.0080.00514.79
5.5.70.0120.00514.77
5.5.60.0050.00814.93
5.5.50.0070.00814.98
5.5.40.0120.00414.93
5.5.30.0070.00414.91
5.5.20.0040.01315.13
5.5.10.0080.00814.84
5.5.00.0050.00914.86

preferences:
54.63 ms | 401 KiB | 5 Q