3v4l.org

run code in 300+ PHP versions simultaneously
<?php function array_del_invalid(&$a, $ikc = [], $ivc = []) { if(! empty($ikc) || ! empty($ivc)) { foreach ($a as $k => $v) { $treated_key = str_replace($ikc, '', $k); $treated_val = str_replace($ivc, '', $v); if($k !== $treated_key) { unset($a[$k]); $a[$treated_key] = $v; } if($v !== $treated_val) { $a[$treated_key] = $treated_val; } } } } $arr = [ 'a' => 'Letter A!', '`b`' => 'Letter B w/quotes...', ' c ' => 'Letter C w/spaces?', ' -_-`d`- _ - ' => 'Letter D w/all?!...' ]; $original_arr = $arr; $invalid_keys_chars = ['`',' ','_','-']; $invalid_vals_chars = ['!','?','.']; array_del_invalid($arr, $invalid_keys_chars, $invalid_vals_chars); var_export($arr); // only keys replacement $arr = $original_arr; array_del_invalid($arr, $invalid_keys_chars); var_export($arr);

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.120.0120.00722.45
8.4.110.0130.00718.50
8.4.100.0110.00717.91
8.4.90.0070.01317.48
8.4.80.0100.01117.77
8.4.70.0120.00919.35
8.4.60.0130.00718.90
8.4.50.0110.00518.05
8.4.40.0030.01617.56
8.4.30.0130.01017.45
8.4.20.0040.00718.63
8.4.10.0150.00619.35
8.3.250.0080.00818.80
8.3.240.0040.00416.40
8.3.230.0090.01116.54
8.3.220.0100.00817.25
8.3.210.0060.01116.57
8.3.200.0050.00416.80
8.3.190.0100.01117.20
8.3.180.0120.00317.30
8.3.170.0160.00318.94
8.3.160.0110.00416.56
8.3.150.0080.01118.77
8.3.140.0000.00916.76
8.3.130.0000.00818.26
8.3.120.0060.00318.73
8.3.110.0090.00320.94
8.3.100.0090.00024.06
8.3.90.0040.00426.77
8.3.80.0110.00017.97
8.3.70.0150.00616.86
8.3.60.0070.00718.55
8.3.50.0060.00818.19
8.3.40.0060.01018.84
8.3.30.0150.00018.79
8.3.20.0090.00018.65
8.3.10.0040.00421.91
8.3.00.0050.00321.60
8.2.290.0110.00820.42
8.2.280.0060.00518.29
8.2.270.0180.00017.40
8.2.260.0050.00318.87
8.2.250.0040.00418.37
8.2.240.0090.00617.17
8.2.230.0110.00022.58
8.2.220.0040.00437.54
8.2.210.0000.00826.77
8.2.200.0060.00316.63
8.2.190.0110.00418.59
8.2.180.0070.01418.16
8.2.170.0110.00422.96
8.2.160.0110.00420.35
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0000.00726.16
8.2.120.0080.00020.77
8.2.110.0090.00020.47
8.2.100.0040.00717.91
8.2.90.0080.00018.03
8.2.80.0040.00417.97
8.2.70.0040.00417.75
8.2.60.0080.00017.93
8.2.50.0030.00618.07
8.2.40.0040.00419.91
8.2.30.0000.00718.15
8.2.20.0000.00718.14
8.2.10.0070.00018.05
8.2.00.0040.00419.56
8.1.330.0130.00620.07
8.1.320.0100.01016.41
8.1.310.0040.00416.94
8.1.300.0030.00616.01
8.1.290.0000.01030.84
8.1.280.0100.00725.92
8.1.270.0030.00622.03
8.1.260.0040.00426.35
8.1.250.0050.00328.09
8.1.240.0120.00022.12
8.1.230.0040.00723.93
8.1.220.0050.00317.78
8.1.210.0060.00318.89
8.1.200.0060.00317.36
8.1.190.0040.00417.23
8.1.180.0030.00518.10
8.1.170.0040.00418.78
8.1.160.0000.00719.03
8.1.150.0070.00018.82
8.1.140.0030.00318.90
8.1.130.0060.00020.19
8.1.120.0000.00717.41
8.1.110.0000.00917.44
8.1.100.0000.00717.43
8.1.90.0020.00517.48
8.1.80.0040.00417.50
8.1.70.0040.00417.46
8.1.60.0000.00917.57
8.1.50.0050.00317.52
8.1.40.0000.00717.50
8.1.30.0020.00517.58
8.1.20.0000.00717.72
8.1.10.0000.00817.57
8.1.00.0040.00417.38
8.0.300.0000.00820.09
8.0.290.0000.00816.58
8.0.280.0000.00718.50
8.0.270.0030.00317.19
8.0.260.0030.00318.50
8.0.250.0040.00416.95
8.0.240.0030.00316.88
8.0.230.0030.00517.01
8.0.220.0050.00216.96
8.0.210.0050.00316.90
8.0.200.0030.00316.88
8.0.190.0000.00716.94
8.0.180.0040.00416.93
8.0.170.0040.00416.86
8.0.160.0040.00416.82
8.0.150.0040.00416.84
8.0.140.0040.00416.89
8.0.130.0030.00313.37
8.0.120.0000.00716.82
8.0.110.0070.00016.83
8.0.100.0000.00716.73
8.0.90.0000.00816.86
8.0.80.0100.00616.95
8.0.70.0040.00417.02
8.0.60.0040.00416.74
8.0.50.0040.00416.89
8.0.30.0090.00917.14
8.0.20.0140.00617.40
8.0.10.0000.00716.98
8.0.00.0130.00916.82
7.4.330.0000.00515.55
7.4.320.0030.00316.53
7.4.300.0030.00316.63
7.4.290.0000.00816.63
7.4.280.0020.00516.61
7.4.270.0050.00316.67
7.4.260.0030.00316.60
7.4.250.0040.00416.38
7.4.240.0050.00216.63
7.4.230.0000.00716.43
7.4.220.0080.00016.62
7.4.210.0050.01016.61
7.4.200.0050.00316.62
7.4.160.0100.00816.51
7.4.140.0090.01017.86
7.4.130.0120.00916.32
7.4.120.0090.01016.59
7.4.110.0070.01016.63
7.4.100.0090.00916.41
7.4.90.0100.00716.65
7.4.80.0060.01119.39
7.4.70.0060.01116.35
7.4.60.0090.00916.52
7.4.50.0040.01516.35
7.4.40.0110.00616.59
7.4.00.0040.01114.92
7.3.330.0050.00013.31
7.3.320.0050.00013.16
7.3.310.0000.00916.43
7.3.300.0070.00016.39
7.3.290.0000.00716.40
7.3.280.0000.01516.33
7.3.260.0130.00816.55
7.3.240.0120.00716.54
7.3.230.0060.01016.60
7.3.210.0030.01716.29
7.3.200.0060.01016.67
7.3.190.0210.00016.57
7.3.180.0030.01716.41
7.3.170.0030.01316.61
7.3.160.0140.00916.41
7.3.00.0080.00416.49
7.2.330.0110.00716.59
7.2.320.0090.01216.58
7.2.310.0070.01316.71
7.2.300.0100.00716.60
7.2.290.0090.00916.70
7.2.130.0040.01117.11
7.2.120.0030.00917.06
7.2.110.0110.00417.03
7.2.100.0690.00615.23
7.2.90.0400.00615.31
7.2.80.0450.00915.30
7.2.70.0320.00615.73
7.2.60.0410.00615.65
7.2.50.0530.00415.54
7.2.40.0510.00415.65
7.2.30.0770.00815.48
7.2.20.0710.01015.53
7.2.10.0430.01015.35
7.2.00.0250.00915.61
7.1.250.0030.00615.82
7.1.240.0000.00815.62
7.1.230.0070.00415.68
7.1.220.0490.00914.42
7.1.210.0890.00814.48
7.1.200.0460.00314.36
7.1.190.0360.00514.51
7.1.180.0390.01014.35
7.1.170.0880.01014.48
7.1.160.0350.00614.36
7.1.150.0280.00814.54
7.1.140.0430.00914.41
7.1.130.0320.00814.40
7.1.120.0660.01014.25
7.1.110.0660.00614.43
7.1.100.0280.00814.38
7.1.90.0310.00714.43
7.1.80.0480.00714.42
7.1.70.0370.00414.49
7.1.60.0470.00926.38
7.1.50.0370.01126.40
7.1.40.0310.01626.51
7.1.30.0750.01026.44
7.1.20.0740.00726.39
7.1.10.0220.00614.24
7.1.00.0560.00314.46
7.0.330.0060.00315.54
7.0.320.0030.00615.52
7.0.310.0150.00614.35
7.0.300.0830.00514.54
7.0.290.0150.01014.47
7.0.280.0140.00814.50
7.0.270.0440.00814.42
7.0.260.0120.00714.56
7.0.250.1200.01014.60
7.0.240.0110.00814.50
7.0.230.0650.00614.28
7.0.220.0280.00214.43
7.0.210.0110.00614.47
7.0.200.0480.01314.36
7.0.190.0140.00614.43
7.0.180.0080.01114.56
7.0.170.0250.00614.57
7.0.160.0090.00714.51
7.0.150.0220.00614.61
7.0.140.0070.00914.44
7.0.130.0090.00714.45
7.0.120.0500.00714.55
7.0.110.0650.01014.51
7.0.100.0630.00914.51
7.0.90.1160.00914.68
7.0.80.0660.01014.37
7.0.70.0140.01114.37
7.0.60.0370.00514.47
7.0.50.0480.00614.68
7.0.40.0470.00313.48
7.0.30.0530.00613.68
7.0.20.0460.00713.38
7.0.10.0420.00313.62
7.0.00.0510.00313.56
5.6.380.0070.00814.25
5.6.370.0070.00814.47
5.6.360.0100.00714.62
5.6.350.0050.01014.10
5.6.340.0120.00514.51
5.6.330.0070.01014.60
5.6.320.0140.00214.50
5.6.310.0110.00814.41
5.6.300.0130.00314.35
5.6.290.0070.01114.67
5.6.280.0090.00714.34
5.6.270.0070.00714.41
5.6.260.0080.00714.55
5.6.250.0110.00514.51
5.6.240.0100.00514.39
5.6.230.0100.00614.34
5.6.220.0100.00714.34
5.6.210.0130.00314.24
5.6.200.0090.00814.43
5.6.190.0040.01214.34
5.6.180.0130.00514.35
5.6.170.0070.00914.41
5.6.160.0060.01214.31
5.6.150.0060.01314.27
5.6.140.0080.00814.55
5.6.130.0090.01114.47
5.6.120.0060.01014.41
5.6.110.0060.00814.34
5.6.100.0110.00414.31
5.6.90.0100.00414.43
5.6.80.0120.00414.27
5.6.70.0050.01014.40
5.6.60.0090.00614.31
5.6.50.0130.00414.22
5.6.40.0110.00314.26
5.6.30.0100.00814.24
5.6.20.0100.00414.34
5.6.10.0100.00414.31
5.6.00.0090.00914.18
5.5.380.0060.00911.60
5.5.370.0080.00511.39
5.5.360.0110.00211.41
5.5.350.0060.00811.33
5.5.340.0040.00811.44
5.5.330.0050.00811.46
5.5.320.0060.00611.41
5.5.310.0080.00311.42
5.5.300.0070.00711.45
5.5.290.0070.00711.49
5.5.280.0060.00911.54
5.5.270.0060.00811.37
5.5.260.0110.00211.41
5.5.250.0080.00211.33
5.5.240.0090.00411.45
5.5.230.0120.00111.37
5.5.220.0080.00611.38
5.5.210.0040.00811.36
5.5.200.0080.00511.46
5.5.190.0090.00611.47
5.5.180.0080.00611.44
5.5.170.0090.00512.82
5.5.160.0040.00711.33
5.5.150.0070.00711.33
5.5.140.0050.00811.42
5.5.130.0030.00711.38
5.5.120.0100.00411.33
5.5.110.0090.00311.33
5.5.100.0050.00711.33
5.5.90.0090.00311.46
5.5.80.0060.00711.33
5.5.70.0090.00411.33
5.5.60.0060.00611.33
5.5.50.0080.00611.41
5.5.40.0080.00311.33
5.5.30.0080.00311.43
5.5.20.0070.00611.44
5.5.10.0030.00811.47
5.5.00.0050.00711.33
5.4.450.0090.00411.33
5.4.440.0050.01011.37
5.4.430.0080.00311.33
5.4.420.0070.00611.36
5.4.410.0060.00411.33
5.4.400.0080.00311.41
5.4.390.0090.00511.33
5.4.380.0020.01011.50
5.4.370.0070.00411.33
5.4.360.0050.00711.53
5.4.350.0060.00711.52
5.4.340.0030.01011.49
5.4.330.0020.01111.33
5.4.320.0070.00311.42
5.4.310.0080.00611.33
5.4.300.0070.00611.33
5.4.290.0090.00511.42
5.4.280.0030.01011.33
5.4.270.0070.00411.33
5.4.260.0090.00211.34
5.4.250.0080.00511.40
5.4.240.0090.00411.35
5.4.230.0090.00511.47
5.4.220.0080.00511.36
5.4.210.0040.00911.33
5.4.200.0040.01011.33
5.4.190.0040.00711.36
5.4.180.0110.00011.44
5.4.170.0050.00511.33
5.4.160.0070.00611.47
5.4.150.0080.00411.48
5.4.140.0060.00611.38
5.4.130.0090.00611.38
5.4.120.0050.00711.38
5.4.110.0050.00511.40
5.4.100.0050.01011.46
5.4.90.0080.00511.35
5.4.80.0070.00611.35
5.4.70.0080.00511.38
5.4.60.0080.00511.33
5.4.50.0060.00911.42
5.4.40.0050.00711.38
5.4.30.0020.00811.33
5.4.20.0040.00811.48
5.4.10.0070.00711.33
5.4.00.0040.00811.33
5.3.290.0050.00511.33
5.3.280.0080.00411.33
5.3.270.0070.00511.33
5.3.260.0070.00411.33
5.3.250.0100.00311.33
5.3.240.0070.00511.33
5.3.230.0060.00611.33
5.3.220.0060.00811.33
5.3.210.0060.00611.33
5.3.200.0090.00211.33
5.3.190.0060.00611.33
5.3.180.0050.00511.33
5.3.170.0070.00311.33
5.3.160.0060.00611.33
5.3.150.0040.00711.33
5.3.140.0060.00511.33
5.3.130.0070.00411.33
5.3.120.0040.00811.33
5.3.110.0070.00511.33
5.3.100.0070.00511.33
5.3.90.0050.00711.33
5.3.80.0080.00411.33
5.3.70.0080.00511.33
5.3.60.0090.00311.33
5.3.50.0040.00711.33
5.3.40.0060.00411.33
5.3.30.0050.00611.33
5.3.20.0050.00611.33
5.3.10.0070.00411.33
5.3.00.0060.00411.33
5.2.170.0030.00711.33
5.2.160.0040.00811.33
5.2.150.0040.00411.33
5.2.140.0050.00511.33
5.2.130.0040.00411.33
5.2.120.0050.00511.33
5.2.110.0040.00511.33
5.2.100.0070.00211.33
5.2.90.0040.00611.33
5.2.80.0060.00611.33
5.2.70.0050.00411.33
5.2.60.0060.00411.33
5.2.50.0030.00511.33
5.2.40.0060.00311.33
5.2.30.0070.00111.33
5.2.20.0090.00011.33
5.2.10.0040.00611.33
5.2.00.0050.00411.33
5.1.60.0060.00111.33
5.1.50.0020.00411.33
5.1.40.0050.00311.33
5.1.30.0040.00511.33
5.1.20.0080.00011.33
5.1.10.0020.00711.33
5.1.00.0030.00511.33
5.0.50.0020.00711.33
5.0.40.0040.00211.33
5.0.30.0020.00411.33
5.0.20.0040.00311.33
5.0.10.0060.00011.33
5.0.00.0040.00211.33
4.4.90.0040.00211.33
4.4.80.0000.00511.33
4.4.70.0000.00611.33
4.4.60.0010.00511.33
4.4.50.0020.00511.33
4.4.40.0020.00411.33
4.4.30.0040.00211.33
4.4.20.0020.00511.33
4.4.10.0020.00411.33
4.4.00.0050.00211.33
4.3.110.0030.00311.33
4.3.100.0030.00311.33
4.3.90.0050.00211.33
4.3.80.0000.00611.33
4.3.70.0040.00211.33
4.3.60.0040.00211.33
4.3.50.0050.00111.33
4.3.40.0050.00011.33
4.3.30.0050.00311.33
4.3.20.0020.00411.33
4.3.10.0010.00411.33
4.3.00.0060.00011.33

preferences:
30.61 ms | 403 KiB | 5 Q