3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(E_ALL); $a = [ [0,1, 2, 3, 4, 0, 5, 6, 4, 3, 2, 1,0], [0, 2, 3, 4, 0, 5, 6, 4, 3, 2, 0], [0, 3, 4, 0, 5, 6, 7,8,4, 3, 0], [-1,0,1,2,3,4,2,1,0,-1] ]; function getMin( $a ) { return min($a); } foreach ($a as $arr) { while( ( $arr != null ) ) { $arr = array_values(array_filter($arr)); if ($arr == null) { break; } $min = getMin( $arr ); foreach ($arr as &$e) { $e -= $min; } unset($e); echo join(" ",$arr),"\n"; } echo "\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)
8.5.10.0160.01019.57
8.5.00.0150.00819.88
8.4.150.0020.00014.05
8.4.140.0130.01317.43
8.4.130.0100.01017.64
8.4.120.0120.00520.59
8.4.110.0150.00822.30
8.4.100.0120.00917.67
8.4.90.0050.00517.95
8.4.80.0120.00919.47
8.4.70.0070.01117.87
8.4.60.0090.01118.70
8.4.50.0100.01018.66
8.4.40.0030.01617.32
8.4.30.0030.00619.65
8.4.20.0040.01617.74
8.4.10.0200.00017.44
8.3.280.0130.00718.51
8.3.270.0110.00916.81
8.3.260.0130.00616.79
8.3.250.0050.00419.23
8.3.240.0120.00516.68
8.3.230.0110.00816.56
8.3.220.0130.00617.10
8.3.210.0110.00816.84
8.3.200.0060.00216.82
8.3.190.0080.00618.99
8.3.180.0060.01416.86
8.3.170.0070.01118.69
8.3.160.0100.01017.04
8.3.150.0130.00718.99
8.3.140.0000.00816.86
8.3.130.0090.00018.46
8.3.120.0080.00819.08
8.3.110.0060.00320.94
8.3.100.0000.00816.65
8.3.90.0060.00318.54
8.3.80.0090.00018.55
8.3.70.0120.00318.36
8.3.60.0110.00716.48
8.3.50.0120.00521.33
8.3.40.0040.01118.84
8.3.30.0040.01118.60
8.3.20.0040.00420.35
8.3.10.0000.00821.77
8.3.00.0030.00517.93
8.2.290.0080.01120.31
8.2.280.0100.01118.46
8.2.270.0030.00519.00
8.2.260.0110.00818.67
8.2.250.0090.00018.45
8.2.240.0060.00917.16
8.2.230.0080.00022.58
8.2.220.0030.00624.06
8.2.210.0040.00426.77
8.2.200.0040.00718.16
8.2.190.0040.01516.63
8.2.180.0140.00318.06
8.2.170.0070.00722.96
8.2.160.0140.00021.14
8.2.150.0050.00324.18
8.2.140.0060.00324.66
8.2.130.0040.00420.38
8.2.120.0040.00426.35
8.2.110.0030.00622.29
8.2.100.0040.00817.78
8.2.90.0040.00417.75
8.2.80.0000.00818.59
8.2.70.0030.00617.75
8.2.60.0040.00417.50
8.2.50.0060.00317.63
8.2.40.0060.00317.63
8.2.30.0040.00419.42
8.2.20.0030.00518.13
8.2.10.0040.00418.34
8.2.00.0070.00018.37
8.1.330.0120.00621.98
8.1.320.0080.00716.11
8.1.310.0030.00616.83
8.1.300.0100.01018.29
8.1.290.0090.00018.88
8.1.280.0070.00725.92
8.1.270.0060.00323.90
8.1.260.0000.00926.35
8.1.250.0000.00728.09
8.1.240.0080.00323.86
8.1.230.0070.00420.93
8.1.220.0040.00417.79
8.1.210.0050.00318.77
8.1.200.0080.00017.35
8.1.190.0000.00817.53
8.1.180.0080.00018.10
8.1.170.0040.00419.13
8.1.160.0080.00018.86
8.1.150.0030.00520.18
8.1.140.0040.00419.56
8.1.130.0000.00717.45
8.1.120.0030.00417.54
8.1.110.0080.00017.45
8.1.100.0040.00417.45
8.1.90.0000.00717.34
8.1.80.0000.00717.32
8.1.70.0000.00717.41
8.1.60.0050.00317.51
8.1.50.0000.00817.51
8.1.40.0000.00817.50
8.1.30.0000.00817.50
8.1.20.0050.00317.49
8.1.10.0040.00417.45
8.1.00.0000.00817.34
8.0.300.0030.00518.77
8.0.290.0000.00916.75
8.0.280.0030.00318.43
8.0.270.0030.00316.72
8.0.260.0040.00416.70
8.0.250.0000.00716.97
8.0.240.0030.00616.86
8.0.230.0030.00316.99
8.0.220.0030.00316.86
8.0.210.0070.00016.76
8.0.200.0030.00316.98
8.0.190.0080.00317.02
8.0.180.0040.00416.82
8.0.170.0040.00416.93
8.0.160.0040.00416.80
8.0.150.0050.00216.86
8.0.140.0080.00016.83
8.0.130.0000.00613.26
8.0.120.0040.00416.88
8.0.110.0000.00716.86
8.0.100.0040.00416.86
8.0.90.0000.00717.01
8.0.80.0090.00916.95
8.0.70.0040.00416.89
8.0.60.0030.00516.84
8.0.50.0070.00016.91
8.0.30.0070.01016.96
8.0.20.0130.00917.40
8.0.10.0030.00516.80
8.0.00.0090.01216.93
7.4.330.0030.00315.55
7.4.320.0030.00316.59
7.4.300.0030.00316.51
7.4.290.0000.00716.62
7.4.280.0000.00716.61
7.4.270.0000.00716.52
7.4.260.0080.00016.64
7.4.250.0030.00316.48
7.4.240.0040.00416.56
7.4.230.0070.00016.32
7.4.220.0040.00416.64
7.4.210.0060.01016.63
7.4.200.0070.00016.35
7.4.160.0100.00616.43
7.4.150.0120.00617.40
7.4.140.0120.01017.86
7.4.130.0090.00916.49
7.4.120.0120.00716.52
7.4.110.0170.00016.56
7.4.100.0070.01316.59
7.4.90.0170.00016.58
7.4.80.0030.01419.39
7.4.70.0110.00816.48
7.4.60.0030.01316.55
7.4.50.0110.00216.53
7.4.40.0140.00316.67
7.4.30.0100.01016.49
7.4.00.0040.01314.75
7.3.330.0030.00313.33
7.3.320.0000.00613.36
7.3.310.0000.00716.23
7.3.300.0030.00316.29
7.3.290.0040.01116.44
7.3.280.0110.00516.40
7.3.270.0060.01217.40
7.3.260.0190.00616.42
7.3.250.0080.01416.44
7.3.240.0110.00716.36
7.3.230.0090.01516.39
7.3.210.0090.01316.62
7.3.200.0140.00316.45
7.3.190.0170.00616.70
7.3.180.0120.00916.51
7.3.170.0100.00716.59
7.3.160.0060.01016.38
7.3.120.0010.01314.93
7.3.110.0060.01014.94
7.3.100.0090.00614.84
7.3.90.0070.01114.79
7.3.80.0110.00414.78
7.3.70.0020.01314.79
7.3.60.0080.00514.75
7.3.50.0100.00714.92
7.3.40.0110.00614.74
7.3.30.0060.00614.79
7.3.20.0090.00616.57
7.3.10.0080.00816.57
7.3.00.0080.00916.60
7.2.330.0160.00316.73
7.2.320.0080.00816.80
7.2.310.0070.01116.71
7.2.300.0150.00416.43
7.2.290.0130.00516.56
7.2.250.0090.01215.01
7.2.240.0050.01014.97
7.2.230.0030.01414.78
7.2.220.0030.01115.07
7.2.210.0040.00915.12
7.2.200.0080.00315.02
7.2.190.0070.00915.13
7.2.180.0030.01114.95
7.2.170.0100.00615.07
7.2.160.0100.00615.04
7.2.150.0090.00416.91
7.2.140.0080.01116.90
7.2.130.0070.00716.91
7.2.120.0090.01216.87
7.2.110.0080.00716.81
7.2.100.0040.01316.89
7.2.90.0040.00916.94
7.2.80.0050.00716.89
7.2.70.0030.01216.93
7.2.60.0070.00617.05
7.2.50.0060.00716.86
7.2.40.0050.00916.70
7.2.30.0050.00817.04
7.2.20.0070.01016.86
7.2.10.0080.00816.77
7.2.00.0090.00316.69
7.1.330.0110.00315.71
7.1.320.0060.00615.71
7.1.310.0080.00715.77
7.1.300.0060.01015.81
7.1.290.0040.01215.81
7.1.280.0070.00715.77
7.1.270.0060.01015.72
7.1.260.0070.00715.83
7.1.250.0090.00715.82
7.1.240.0230.00015.72
7.1.230.0220.00715.89
7.1.220.0120.00815.54
7.1.210.0160.00315.92
7.1.200.0060.01115.75
7.1.190.0160.00415.86
7.1.180.0160.01615.84
7.1.170.0120.01215.57
7.1.160.0110.00815.67
7.1.150.0100.01315.97
7.1.140.0220.00615.53
7.1.130.0140.00915.59
7.1.120.0220.00615.77
7.1.110.0080.01115.98
7.1.100.0260.00315.72
7.1.90.0180.01115.93
7.1.80.0130.00915.88
7.1.70.0060.01116.27
7.1.60.0080.01516.53
7.1.50.0140.00415.71
7.1.40.0130.00624.87
7.1.30.0160.00925.13
7.1.20.0200.00525.13
7.1.10.0110.00916.04
7.1.00.0090.01116.20
7.0.330.0130.00715.50
7.0.320.0210.00015.38
7.0.310.0190.00315.19
7.0.300.0110.00815.37
7.0.290.0090.00915.63
7.0.280.0170.01015.25
7.0.270.0130.01115.33
7.0.260.0180.01115.66
7.0.250.0310.00815.38
7.0.240.0270.00815.35
7.0.230.0220.01315.44
7.0.220.0220.01115.46
7.0.210.0170.00315.48
7.0.200.0060.01316.02
7.0.190.0150.00415.38
7.0.180.0090.00615.71
7.0.170.0040.01115.77
7.0.160.0050.01215.79
7.0.150.0080.01115.71
7.0.140.0060.00915.95
7.0.130.0070.01215.93
7.0.120.0110.00715.82
7.0.110.0110.00815.80
7.0.100.0110.00515.91
7.0.90.0030.01115.88
7.0.80.0120.00615.85
7.0.70.0070.00715.84
7.0.60.0130.00915.85
7.0.50.0080.01115.85
7.0.40.0120.00615.96
7.0.30.0100.00916.11
7.0.20.0080.00916.03
7.0.10.0110.00615.87
7.0.00.0160.00815.90
5.6.400.0230.00814.34
5.6.390.0180.00314.21
5.6.380.0090.01214.63
5.6.370.0180.00614.34
5.6.360.0180.00514.53
5.6.350.0140.01114.24
5.6.340.0130.00714.41
5.6.330.0110.00814.05
5.6.320.0120.01214.15
5.6.310.0300.00414.39
5.6.300.0170.02917.58
5.6.290.0090.03017.33
5.6.280.0160.03917.69
5.6.270.0140.03817.80
5.6.260.0130.02817.78
5.6.250.0130.03817.47
5.6.240.0090.03517.66
5.6.230.0100.03517.57
5.6.220.0140.03217.47
5.6.210.0120.03517.62
5.6.200.0130.03217.60
5.6.190.0190.04517.59
5.6.180.0180.03217.54
5.6.170.0190.03317.44
5.6.160.0110.03317.51
5.6.150.0090.03717.40
5.6.140.0130.03717.75
5.6.130.0200.02917.67
5.6.120.0130.04317.64
5.6.110.0180.03117.55
5.6.100.0090.04317.77
5.6.90.0220.04317.38
5.6.80.0140.03917.15
5.6.70.0110.03517.20
5.6.60.0100.03517.20
5.6.50.0120.03917.17
5.6.40.0150.03317.32
5.6.30.0040.04217.18
5.6.20.0140.03217.10
5.6.10.0080.03117.05
5.6.00.0070.03617.18
5.5.380.0100.00614.10
5.5.370.0030.01314.51
5.5.360.0240.00914.16
5.5.350.0190.00314.42
5.5.340.0040.01014.45
5.5.330.0210.00514.38
5.5.320.0100.00714.13
5.5.310.0140.00614.07
5.5.300.0160.01214.22
5.5.290.0180.01114.36
5.5.280.0120.01614.13
5.5.270.0070.01014.15
5.5.260.0180.00914.27
5.5.250.0130.00814.34
5.5.240.0140.00714.40
5.5.230.0150.00814.23
5.5.220.0280.00614.00
5.5.210.0120.01214.00
5.5.200.0150.01514.28
5.5.190.0170.00914.24
5.5.180.0150.00514.27
5.5.170.0200.00314.20
5.5.160.0150.00714.24
5.5.150.0160.00814.17
5.5.140.0120.00514.50
5.5.130.0180.01214.52
5.5.120.0030.01814.24
5.5.110.0110.00614.40
5.5.100.0150.00714.20
5.5.90.0200.00014.14
5.5.80.0110.01114.09
5.5.70.0110.01714.14
5.5.60.0140.01414.17
5.5.50.0170.00314.26
5.5.40.0150.01514.17
5.5.30.0210.00714.29
5.5.20.0140.01414.19
5.5.10.0070.02113.96
5.5.00.0100.01014.30
5.4.450.0060.01111.35
5.4.440.0140.00011.15
5.4.430.0100.00311.26
5.4.420.0070.01411.20
5.4.410.0220.00011.05
5.4.400.0150.00411.05
5.4.390.0080.00811.11
5.4.380.0120.01611.16
5.4.370.0170.00610.76
5.4.360.0150.00010.93
5.4.350.0120.00611.19
5.4.340.0110.00010.93
5.4.330.0080.01011.05
5.4.320.0130.00511.05
5.4.310.0100.00511.35
5.4.300.0150.00411.18
5.4.290.0090.01010.83
5.4.280.0160.00611.10
5.4.270.0150.00410.80
5.4.260.0050.00811.05
5.4.250.0090.00511.01
5.4.240.0140.00411.23
5.4.230.0150.00410.89
5.4.220.0160.00010.95
5.4.210.0160.00311.27
5.4.200.0070.01511.22
5.4.190.0120.00410.99
5.4.180.0080.00511.07
5.4.170.0120.00410.75
5.4.160.0000.01410.95
5.4.150.0170.00010.93
5.4.140.0150.00411.11
5.4.130.0130.01011.15
5.4.120.0090.00410.96
5.4.110.0140.00311.18
5.4.100.0160.00411.11
5.4.90.0070.01311.34
5.4.80.0120.00811.28
5.4.70.0180.00410.96
5.4.60.0140.00411.10
5.4.50.0080.00811.20
5.4.40.0080.01211.22
5.4.30.0140.00711.14
5.4.20.0140.00610.87
5.4.10.0170.00711.00
5.4.00.0140.00210.86
5.3.290.0040.00410.29
5.3.280.0100.00310.04
5.3.270.0130.01010.09
5.3.260.0040.00810.16
5.3.250.0090.00610.13
5.3.240.0070.00710.08
5.3.230.0030.01010.06
5.3.220.0120.00610.05
5.3.210.0100.00510.20
5.3.200.0190.0009.94
5.3.190.0080.01210.18
5.3.180.0120.00010.13
5.3.170.0130.00610.13
5.3.160.0160.00410.14
5.3.150.0140.00710.22
5.3.140.0040.01410.16
5.3.130.0120.00410.29
5.3.120.0130.00010.17
5.3.110.0140.00710.32
5.3.100.0080.00810.23
5.3.90.0060.00910.39
5.3.80.0120.00610.15
5.3.70.0080.00810.06
5.3.60.0130.00010.18
5.3.50.0040.00910.16
5.3.40.0100.01010.10
5.3.30.0130.00810.11
5.3.20.0040.00910.13
5.3.10.0180.0009.89
5.3.00.0060.0069.89
5.2.170.0070.0039.25
5.2.160.0050.0059.34
5.2.150.0090.0069.17
5.2.140.0090.0099.23
5.2.130.0040.0089.23
5.2.120.0050.0059.17
5.2.110.0050.0059.17
5.2.100.0080.0089.17
5.2.90.0160.0009.18
5.2.80.0050.0059.17
5.2.70.0100.0059.17
5.2.60.0050.0139.17
5.2.50.0030.0079.23
5.2.40.0180.0009.17
5.2.30.0130.0039.22
5.2.20.0100.0009.17
5.2.10.0140.0059.17
5.2.00.0090.0039.17
5.1.60.0100.0079.17
5.1.50.0120.0039.17
5.1.40.0060.0039.17
5.1.30.0050.0059.17
5.1.20.0080.0049.17
5.1.10.0120.0039.17
5.1.00.0050.0029.17
5.0.50.0040.0049.17
5.0.40.0050.0029.17
5.0.30.0040.0079.17
5.0.20.0070.0079.17
5.0.10.0040.0029.17
5.0.00.0080.0039.17
4.4.90.0000.0089.17
4.4.80.0060.0029.17
4.4.70.0070.0039.17
4.4.60.0040.0049.17
4.4.50.0080.0049.17
4.4.40.0060.0069.17
4.4.30.0070.0059.17
4.4.20.0060.0069.17
4.4.10.0080.0039.17
4.4.00.0070.0019.17
4.3.110.0040.0049.17
4.3.100.0050.0059.17
4.3.90.0100.0009.17
4.3.80.0060.0069.17
4.3.70.0040.0049.17
4.3.60.0030.0039.17
4.3.50.0000.0069.17
4.3.40.0030.0059.17
4.3.30.0070.0029.17
4.3.20.0030.0039.17
4.3.10.0050.0069.17
4.3.00.0000.0059.17

preferences:
17.96 ms | 403 KiB | 5 Q