3v4l.org

run code in 300+ PHP versions simultaneously
<?php $vars = ['len' => '-1', 'start' => '0', 'cNum' => '7', 'cSearch_0' => 'b', 'cSearch_1' => 'c', 'cSearch_2' => 'd', 'cSearch_3' => 'e', 'cSearch_4' => 'f', 'cSearch_5' => 'g', 'cSearch_6' => 'h', 'cSort_0' => 'asc', 'cSort_1' => 'asc', 'search' => 'a']; function _filterArrayByKey(string $filter, $array){ return array_filter( $array, function($k) use ($filter){ return preg_match('/(' . $filter . ')/',$k); }, ARRAY_FILTER_USE_KEY ); } // $v = preg_grep('/[cSearch]\_/', array_keys($vars)); // $cSearch = array_filter($vars, function($k){ return preg_match('/(cSearch)/',$k);}, ARRAY_FILTER_USE_KEY); $cVis = _filterArrayByKey('cVis',$vars); var_dump($cVis); if(!empty($cVis)){ $cVisStr = 'columnDefs: [ { targets: [ '; $cVisInd = []; for ($i = 0; $i < $vars['cNum']; $i++){ if(array_key_exists('cVis_' . $i, $cVis)){ $cVisInd[] = (int) $i; } } $cVisStr .= implode(',',$cVisInd) .'], visible: false} ]'; $jsout[] = $cVisStr; } var_dump($cVisStr);

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.40.0120.00318.93
8.3.30.0000.01519.00
8.3.20.0080.00019.28
8.3.10.0000.00823.71
8.3.00.0040.00420.55
8.2.170.0030.01322.96
8.2.160.0030.01220.39
8.2.150.0080.00024.18
8.2.140.0070.00724.66
8.2.130.0150.00318.09
8.2.120.0000.00826.35
8.2.110.0040.00419.25
8.2.100.0090.00317.84
8.2.90.0040.00418.00
8.2.80.0000.00817.97
8.2.70.0050.00317.91
8.2.60.0000.00818.03
8.2.50.0060.00318.10
8.2.40.0000.00819.48
8.2.30.0080.00019.25
8.2.20.0000.00818.16
8.2.10.0000.00718.04
8.2.00.0000.00917.90
8.1.270.0050.00320.64
8.1.260.0030.00626.35
8.1.250.0070.00028.09
8.1.240.0000.00923.69
8.1.230.0040.00722.15
8.1.220.0060.00317.79
8.1.210.0040.00418.77
8.1.200.0000.00817.48
8.1.190.0030.00617.48
8.1.180.0000.00718.10
8.1.170.0000.00818.78
8.1.160.0000.00818.90
8.1.150.0040.00418.81
8.1.140.0000.00722.29
8.1.130.0000.00720.19
8.1.120.0040.00417.64
8.1.110.0080.00017.61
8.1.100.0080.00017.52
8.1.90.0070.00017.51
8.1.80.0050.00317.60
8.1.70.0030.00617.54
8.1.60.0030.00717.73
8.1.50.0030.00517.59
8.1.40.0030.00717.75
8.1.30.0030.00617.75
8.1.20.0080.00017.84
8.1.10.0040.00417.66
8.1.00.0000.00817.49
8.0.300.0040.00418.77
8.0.290.0060.00317.13
8.0.280.0080.00018.55
8.0.270.0050.00317.35
8.0.260.0040.00418.53
8.0.250.0070.00317.14
8.0.240.0040.00417.13
8.0.230.0070.00017.09
8.0.220.0030.00517.09
8.0.210.0030.00317.12
8.0.200.0070.00017.15
8.0.190.0040.00417.14
8.0.180.0030.00617.04
8.0.170.0030.00617.14
8.0.160.0000.00717.18
8.0.150.0040.00417.11
8.0.140.0040.00417.06
8.0.130.0060.00013.53
8.0.120.0000.00717.20
8.0.110.0000.00717.00
8.0.100.0040.00417.03
8.0.90.0000.00717.08
8.0.80.0060.01017.09
8.0.70.0040.00417.01
8.0.60.0040.00417.17
8.0.50.0040.00417.00
8.0.30.0080.01217.32
8.0.20.0110.00817.40
8.0.10.0000.00817.11
8.0.00.0110.00716.98
7.4.330.0030.00315.55
7.4.320.0040.00416.80
7.4.300.0000.00716.87
7.4.290.0000.00716.87
7.4.280.0000.00916.57
7.4.270.0060.00316.64
7.4.260.0070.00016.81
7.4.250.0040.00416.60
7.4.240.0030.00316.84
7.4.230.0040.00416.74
7.4.220.0000.00816.95
7.4.210.0080.01016.83
7.4.200.0000.00816.63
7.4.160.0100.00916.79
7.4.140.0130.00917.86
7.4.130.0060.01216.56
7.4.120.0120.00616.63
7.4.110.0100.01016.66
7.4.100.0100.00716.82
7.4.90.0070.01016.83
7.4.80.0030.01819.39
7.4.70.0120.00916.83
7.4.60.0120.00416.76
7.4.50.0070.01016.54
7.4.40.0040.01216.52
7.3.330.0030.00313.39
7.3.320.0000.00613.36
7.3.310.0000.00716.59
7.3.300.0070.00016.56
7.3.290.0080.00016.56
7.3.280.0070.01116.41
7.3.260.0120.00716.62
7.3.240.0110.00816.61
7.3.230.0090.01516.83
7.3.210.0090.00916.67
7.3.200.0100.00616.59
7.3.190.0130.01016.80
7.3.180.0060.00916.78
7.3.170.0140.00316.54
7.3.160.0160.00616.85
7.2.330.0140.00616.70
7.2.320.0180.00616.96
7.2.310.0090.00916.89
7.2.300.0100.00616.64
7.2.290.0130.00416.89

preferences:
60.72 ms | 400 KiB | 5 Q