3v4l.org

run code in 300+ PHP versions simultaneously
<?php if (!function_exists('array_column')) { function array_column($input, $column_key, $index_key = null) { if ($index_key !== null) { // Collect the keys $keys = array(); $i = 0; // Counter for numerical keys when key does not exist foreach ($input as $row) { if (array_key_exists($index_key, $row)) { // Update counter for numerical keys if (is_numeric($row[$index_key]) || is_bool($row[$index_key])) { $i = max($i, (int) $row[$index_key] + 1); } // Get the key from a single column of the array $keys[] = $row[$index_key]; } else { // The key does not exist, use numerical indexing $keys[] = $i++; } } } if ($column_key !== null) { // Collect the values $values = array(); $i = 0; // Counter for removing keys foreach ($input as $row) { if (array_key_exists($column_key, $row)) { // Get the values from a single column of the input array $values[] = $row[$column_key]; $i++; } elseif (isset($keys)) { // Values does not exist, also drop the key for it array_splice($keys, $i, 1); } } } else { // Get the full arrays $values = array_values($input); } if ($index_key !== null) { return array_combine($keys, $values); } return $values; } echo "Custom array_column()"; } $start = microtime(true); for ($i=0;$i<9999;$i++) { fmod(34, 4294967296); } $end = microtime(true); echo $end-$start."\n"; $start = microtime(true); for ($i=0;$i<9999;$i++) { bcmod('34', '4294967296'); } $end = microtime(true); echo $end-$start."\n";

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)
7.4.10.0100.01616.35
7.4.00.0090.01616.39
7.3.130.0070.01716.30
7.3.120.0140.01516.27
7.3.110.0000.02216.18
7.3.100.0070.01416.13
7.3.90.0060.01516.44
7.3.80.0070.01716.17
7.3.70.0060.01616.44
7.3.60.0090.01216.36
7.3.50.0060.01616.24
7.3.40.0060.01616.38
7.3.30.0000.02216.41
7.3.20.0000.02018.27
7.3.10.0070.01017.96
7.3.00.0080.01518.02
7.2.260.0100.02116.72
7.2.250.0000.03116.81
7.2.240.0070.02116.71
7.2.230.0030.01716.69
7.2.220.0120.01216.61
7.2.210.0030.01516.59
7.2.200.0040.02416.50
7.2.190.0100.01016.56
7.2.180.0040.01816.65
7.2.170.0030.01616.42
7.2.160.0000.01616.60
7.2.150.0070.01418.31
7.2.140.0070.01418.50
7.2.130.0070.01118.41
7.2.120.0030.01318.53
7.2.110.0090.01518.36
7.2.100.0070.01618.34
7.2.90.0030.01918.37
7.2.80.0030.01818.45
7.2.70.0040.02218.41
7.2.60.0030.02018.46
7.2.50.0060.01518.53
7.2.40.0060.01318.35
7.2.30.0060.01618.25
7.2.20.0070.02218.37
7.2.10.0040.01218.57
7.2.00.0040.01818.33
7.1.330.0090.01517.36
7.1.320.0070.01817.43
7.1.310.0100.01617.37
7.1.300.0090.01217.41
7.1.290.0000.02417.38
7.1.280.0000.02417.29
7.1.270.0060.02517.21
7.1.260.0030.02317.30
7.1.250.0110.01417.52
7.1.240.0030.01817.34
7.1.230.0030.01317.13
7.1.220.0000.01917.25
7.1.210.0060.01617.23
7.1.200.0040.02117.32
7.1.190.0090.01517.23
7.1.180.0090.01217.30
7.1.170.0030.01717.44
7.1.160.0000.02117.33
7.1.150.0030.02117.25
7.1.140.0060.01817.23
7.1.130.0030.02017.39
7.1.120.0070.01717.20
7.1.110.0030.02017.44
7.1.100.0040.02217.34
7.1.90.0030.02017.29
7.1.80.0070.01717.45
7.1.70.0090.01917.17
7.1.60.0070.02218.60
7.1.50.0030.02217.06
7.1.40.0100.01017.29
7.1.30.0090.01217.37
7.1.20.0040.01917.48
7.1.10.0060.01917.55
7.1.00.0030.04819.94
7.0.330.0000.02117.20
7.0.320.0070.01817.10
7.0.310.0030.01916.84
7.0.300.0030.01617.00
7.0.290.0060.01616.93
7.0.280.0100.02016.98
7.0.270.0060.01517.01
7.0.260.0100.01316.93
7.0.250.0030.01617.11
7.0.240.0100.01317.02
7.0.230.0090.01317.33
7.0.220.0100.01317.16
7.0.210.0070.01017.07
7.0.200.0060.01316.88
7.0.190.0040.02217.03
7.0.180.0070.01617.06
7.0.170.0060.01617.00
7.0.160.0130.01316.96
7.0.150.0070.01417.14
7.0.140.0050.04919.63
7.0.130.0060.01616.96
7.0.120.0000.01717.07
7.0.110.0000.01717.14
7.0.100.0030.01617.10
7.0.90.0140.01116.98
7.0.80.0000.02117.11
7.0.70.0070.01117.21
7.0.60.0060.04918.55
7.0.50.0080.04817.43
7.0.40.0070.05017.63
7.0.30.0020.04117.65
7.0.20.0180.05117.75
7.0.10.0030.05317.72
7.0.00.0080.03317.63
5.6.400.0070.02015.91
5.6.390.0100.01916.05
5.6.380.0030.02716.27
5.6.370.0030.02316.04
5.6.360.0030.02216.37
5.6.350.0030.02715.82
5.6.340.0030.03115.93
5.6.330.0120.01216.35
5.6.320.0070.01716.07
5.6.310.0000.01915.70
5.6.300.0070.01615.96
5.6.290.0030.02315.72
5.6.280.0050.05118.53
5.6.270.0070.01715.94
5.6.260.0030.01715.62
5.6.250.0030.02416.00
5.6.240.0100.01915.82
5.6.230.0030.02415.82
5.6.220.0040.02215.72
5.6.210.0080.04818.27
5.6.200.0050.05217.11
5.6.190.0120.05318.19
5.6.180.0270.05118.38
5.6.170.0130.05718.15
5.6.160.0030.04118.29
5.6.150.0040.03716.95
5.6.140.0050.04017.05
5.6.130.0080.04117.00
5.6.120.0130.04718.60
5.6.110.0080.03618.37
5.6.100.0020.03618.37
5.6.90.0080.05618.62
5.6.80.0030.05918.08
5.6.70.0070.02015.79
5.6.60.0070.01815.71
5.6.50.0100.01615.54
5.6.40.0060.01915.67
5.6.30.0060.01916.04
5.6.20.0070.01415.74
5.6.10.0000.02615.77
5.6.00.0060.01916.03
5.5.380.0060.01915.94
5.5.370.0070.01815.99
5.5.360.0030.02415.63
5.5.350.0150.05718.21
5.5.340.0050.05316.92
5.5.330.0120.04118.17
5.5.320.0250.05218.14
5.5.310.0190.04618.15
5.5.300.0050.03317.05
5.5.290.0040.03417.07
5.5.280.0020.03918.47
5.5.270.0050.04518.34
5.5.260.0120.05518.46
5.5.250.0110.04918.35
5.5.240.0050.05018.16
5.5.230.0110.01415.85
5.5.220.0030.02215.68
5.5.210.0100.01615.90
5.5.200.0140.02015.89
5.5.190.0000.02315.99
5.5.180.0090.01215.65
5.5.170.0030.02415.78
5.5.160.0070.02015.79
5.5.150.0060.01815.73
5.5.140.0000.02115.73
5.5.130.0030.02115.88
5.5.120.0070.01815.80
5.5.110.0030.02215.81
5.5.100.0060.01915.91
5.5.90.0160.01315.99
5.5.80.0030.02015.83
5.5.70.0120.01215.84
5.5.60.0000.02915.79
5.5.50.0100.01615.80
5.5.40.0000.02415.80
5.5.30.0000.02915.84
5.5.20.0040.02215.74
5.5.10.0070.02015.75
5.5.00.0120.00915.81
5.4.450.0050.03516.14
5.4.440.0020.03016.11
5.4.430.0030.05016.19
5.4.420.0020.05716.33
5.4.410.0060.03116.02
5.4.400.0040.02715.91
5.4.390.0080.04715.87
5.4.380.0080.03115.95
5.4.370.0070.04316.00
5.4.360.0050.03515.72
5.4.350.0020.04915.91
5.4.340.0090.03816.00
5.4.330.0090.00612.75
5.4.320.0070.04615.85
5.4.310.0070.03115.90
5.4.300.0050.04215.91
5.4.290.0020.04915.81
5.4.280.0080.04615.85
5.4.270.0030.04916.01
5.4.260.0090.04215.70
5.4.250.0050.05015.83
5.4.240.0060.04815.99
5.4.230.0050.04316.07
5.4.220.0180.02315.82
5.4.210.0030.02716.11
5.4.200.0040.03915.85
5.4.190.0070.04415.96
5.4.180.0100.04615.85
5.4.170.0060.03816.03
5.4.160.0050.02815.92
5.4.150.0020.03215.85
5.4.140.0020.04514.44
5.4.130.0050.04514.55
5.4.120.0100.04014.63
5.4.110.0030.04814.77
5.4.100.0070.04014.59
5.4.90.0020.04914.65
5.4.80.0030.04514.69
5.4.70.0030.03714.59
5.4.60.0050.04314.58
5.4.50.0040.03314.67
5.4.40.0070.04114.66
5.4.30.0050.03214.59
5.4.20.0000.03614.63
5.4.10.0080.03914.53
5.4.00.0050.04114.25
5.3.290.0030.04113.87
5.3.280.0030.04113.75
5.3.270.0030.05413.86
5.3.260.0070.05313.96
5.3.250.0080.04813.84
5.3.240.0050.04813.80
5.3.230.0050.05113.84
5.3.220.0020.04913.85
5.3.210.0050.04013.75
5.3.200.0000.05113.72
5.3.190.0060.04713.77
5.3.180.0020.03913.91
5.3.170.0020.05013.95
5.3.160.0020.05313.85
5.3.150.0000.03613.86
5.3.140.0080.04713.78
5.3.130.0000.04213.74
5.3.120.0080.05013.79
5.3.110.0050.03313.76
5.3.100.0070.05013.56
5.3.90.0050.05213.54
5.3.80.0000.04813.51
5.3.70.0050.04513.51
5.3.60.0060.05413.56
5.3.50.0060.04413.69
5.3.40.0050.03013.52
5.3.30.0080.04913.70
5.3.20.0030.04513.36
5.3.10.0040.04213.26
5.3.00.0020.04513.29
5.2.170.0030.04712.59
5.2.160.0030.03312.59
5.2.150.0000.04012.59
5.2.140.0030.06012.59
5.2.130.0030.06312.59
5.2.120.0000.04012.59
5.2.110.0000.07712.59
5.2.100.0000.07712.59
5.2.90.0000.07712.59
5.2.80.0030.07312.59
5.2.70.0070.07312.59
5.2.60.0000.07712.59
5.2.50.0030.07012.59
5.2.40.0000.06012.59
5.2.30.0000.05012.59
5.2.20.0000.07012.59
5.2.10.0000.07012.59
5.2.00.0000.07712.59
5.1.60.0070.06312.59
5.1.50.0000.06312.59
5.1.40.0070.04312.59
5.1.30.0100.05312.59
5.1.20.0030.06712.59
5.1.10.0030.07012.59
5.1.00.0000.05712.59
5.0.50.0000.03712.59
5.0.40.0000.06312.59
5.0.30.0030.07312.59
5.0.20.0070.05012.59
5.0.10.0100.05712.59
5.0.00.0030.07712.59
4.4.90.0030.03312.59
4.4.80.0000.05312.59
4.4.70.0000.05012.59
4.4.60.0000.05312.59
4.4.50.0000.05312.59
4.4.40.0030.05712.59
4.4.30.0000.05312.59
4.4.20.0070.04712.59
4.4.10.0070.04712.59
4.4.00.0000.06312.59
4.3.110.0030.05312.59
4.3.100.0000.04012.59
4.3.90.0030.05312.59
4.3.80.0030.06712.59
4.3.70.0030.05012.59
4.3.60.0000.04712.59
4.3.50.0030.04312.59
4.3.40.0000.04312.59
4.3.30.0000.05712.59
4.3.20.0030.05012.59
4.3.10.0000.04312.59
4.3.00.0000.04712.59

preferences:
37.47 ms | 401 KiB | 5 Q