3v4l.org

run code in 300+ PHP versions simultaneously
<?php function testAsc($array) { $memory=null; foreach($array as $member) { if ($memory)if($member<=$memory)return false; $memory=$member; } return true; } function solution($array) { for($i=0;$i<count($array);$i++) { $currentArray=array_filter($array, function($index) use($i) { return $i != $index; }, ARRAY_FILTER_USE_KEY); if(testAsc($currentArray)) return implode($currentArray) . "\n"; } return 'nie da sie' . "\n"; } echo solution([1, 2, 3, 4]);//234 echo solution([1, 7, 7, 4]);//nie da sie echo solution([1, 7, 2, 4]);//124

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.70.0130.00316.58
8.3.60.0140.00016.61
8.3.50.0070.00717.42
8.3.40.0060.01018.84
8.3.30.0090.00618.46
8.3.20.0040.00420.42
8.3.10.0040.00423.52
8.3.00.0040.00423.68
8.2.190.0110.01116.58
8.2.180.0210.00016.38
8.2.170.0030.01422.96
8.2.160.0000.01920.53
8.2.150.0070.00024.18
8.2.140.0000.00824.66
8.2.130.0000.00722.29
8.2.120.0020.00526.35
8.2.110.0030.00722.30
8.2.100.0070.00418.03
8.2.90.0090.00018.22
8.2.80.0080.00018.05
8.2.70.0050.00318.04
8.2.60.0050.00318.22
8.2.50.0030.00618.10
8.2.40.0050.00320.55
8.2.30.0040.00420.91
8.2.20.0070.00017.95
8.2.10.0000.00818.20
8.2.00.0000.00818.19
8.1.280.0060.00925.92
8.1.270.0040.00423.99
8.1.260.0040.00426.35
8.1.250.0000.00728.09
8.1.240.0060.00620.81
8.1.230.0000.01120.91
8.1.220.0050.00317.74
8.1.210.0090.00418.77
8.1.200.0060.00317.35
8.1.190.0000.00817.35
8.1.180.0040.00418.10
8.1.170.0040.00418.68
8.1.160.0090.00018.91
8.1.150.0060.00318.82
8.1.140.0040.00417.62
8.1.130.0000.00718.97
8.1.120.0040.00417.54
8.1.110.0040.00417.45
8.1.100.0080.00017.36
8.1.90.0070.00017.44
8.1.80.0040.00417.38
8.1.70.0000.00817.36
8.1.60.0040.00417.59
8.1.50.0090.00017.54
8.1.40.0000.00717.54
8.1.30.0000.00817.63
8.1.20.0050.00317.57
8.1.10.0040.00417.52
8.1.00.0000.00717.34
8.0.300.0000.00819.64
8.0.290.0090.00316.63
8.0.280.0070.00018.44
8.0.270.0030.00316.84
8.0.260.0080.00016.84
8.0.250.0000.00816.85
8.0.240.0030.00516.95
8.0.230.0060.00316.98
8.0.220.0040.00416.93
8.0.210.0040.00416.87
8.0.200.0050.00216.95
8.0.190.0080.00316.93
8.0.180.0040.00416.99
8.0.170.0000.00716.97
8.0.160.0040.00416.92
8.0.150.0110.00016.79
8.0.140.0000.00716.75
8.0.130.0060.00313.35
8.0.120.0040.00416.78
8.0.110.0000.00716.90
8.0.100.0000.00816.93
8.0.90.0030.00316.95
8.0.80.0110.00616.95
8.0.70.0000.00716.97
8.0.60.0000.00816.95
8.0.50.0040.00416.79
8.0.30.0100.00817.05
8.0.20.0090.01117.40
8.0.10.0000.00717.04
8.0.00.0090.00916.88
7.4.330.0060.00016.59
7.4.320.0000.00716.62
7.4.300.0000.00716.63
7.4.290.0070.00016.59
7.4.280.0000.00816.52
7.4.270.0050.00316.51
7.4.260.0030.00516.62
7.4.250.0080.00016.38
7.4.240.0000.00816.45
7.4.230.0030.00316.60
7.4.220.0100.01016.67
7.4.210.0100.00316.50
7.4.200.0030.00316.45
7.4.150.0030.01517.40
7.4.140.0100.00817.86
7.4.130.0060.01316.39
7.4.120.0140.00816.58
7.4.110.0090.01216.48
7.4.100.0180.00616.59
7.4.90.0100.00716.42
7.4.80.0060.01219.39
7.4.70.0100.01316.46
7.4.60.0100.00716.61
7.4.50.0030.01416.25
7.4.40.0140.01216.49
7.4.30.0080.00816.64
7.4.10.0080.01215.74
7.4.00.0050.01015.46
7.3.330.0020.00213.23
7.3.320.0000.00713.34
7.3.310.0030.00316.38
7.3.300.0070.00016.38
7.3.290.0050.00916.35
7.3.280.0090.00716.34
7.3.270.0130.00317.40
7.3.260.0060.01216.39
7.3.250.0110.01016.45
7.3.240.0080.01116.42
7.3.230.0090.00916.43
7.3.210.0160.00016.56
7.3.200.0050.01116.52
7.3.190.0130.00316.39
7.3.180.0080.00816.51
7.3.170.0050.01116.29
7.3.160.0070.01416.27
7.3.130.0080.00815.75
7.3.120.0050.01015.53
7.3.110.0040.01215.48
7.3.100.0100.00615.55
7.3.90.0070.01015.69
7.3.80.0050.01215.85
7.3.70.0090.00315.54
7.3.60.0080.00815.65
7.3.50.0050.00515.54
7.3.40.0060.00915.69
7.3.30.0080.00515.67
7.3.20.0080.00317.54
7.3.10.0060.00817.28
7.3.00.0050.00917.35
7.2.330.0110.00716.94
7.2.320.0060.01416.46
7.2.310.0060.01016.50
7.2.300.0090.00616.66
7.2.290.0130.01016.80
7.2.260.0080.00815.91
7.2.250.0030.01615.67
7.2.240.0050.01115.59
7.2.230.0080.01315.99
7.2.220.0040.01115.85
7.2.210.0050.01415.73
7.2.200.0090.00815.81
7.2.190.0090.00715.78
7.2.180.0090.00415.82
7.2.170.0050.00715.78
7.2.160.0020.01515.69
7.2.150.0040.01317.74
7.2.140.0020.01217.77
7.2.130.0070.00717.72
7.2.120.0080.00817.69
7.2.110.0070.00917.70
7.2.100.0070.00917.63
7.2.90.0100.00717.56
7.2.80.0100.00317.73
7.2.70.0060.01017.56
7.2.60.0010.01217.50
7.2.50.0040.00917.66
7.2.40.0050.01217.75
7.2.30.0050.01117.60
7.2.20.0030.01017.74
7.2.10.0060.00917.68
7.2.00.0030.01017.65
7.1.330.0050.00716.65
7.1.320.0060.01116.58
7.1.310.0070.00816.67
7.1.300.0050.01216.52
7.1.290.0090.00616.50
7.1.280.0060.00316.41
7.1.270.0050.00816.63
7.1.260.0110.00116.68
7.1.250.0020.00816.59
7.1.240.0050.00816.50
7.1.230.0070.00516.69
7.1.220.0050.00916.59
7.1.210.0050.00916.45
7.1.200.0120.00616.27
7.1.190.0100.00516.62
7.1.180.0040.00616.70
7.1.170.0050.01116.57
7.1.160.0100.00516.55
7.1.150.0050.01016.58
7.1.140.0060.00816.52
7.1.130.0020.01216.56
7.1.120.0030.01116.61
7.1.110.0080.01017.09
7.1.100.0030.01117.20
7.1.90.0040.01017.00
7.1.80.0040.00817.18
7.1.70.0080.00716.83
7.1.60.0090.01322.76
7.1.50.0080.01222.64
7.1.40.0080.00922.47
7.1.30.0120.00522.60
7.1.20.0100.00922.62
7.1.10.0060.00916.68
7.1.00.0040.01016.59
7.0.330.0030.01016.12
7.0.320.0060.00516.13
7.0.310.0050.00816.24
7.0.300.0050.00716.25
7.0.290.0060.00616.27
7.0.280.0050.00516.13
7.0.270.0030.01216.30
7.0.260.0030.01016.21
7.0.250.0060.01016.85
7.0.240.0070.00916.80
7.0.230.0040.00816.78
7.0.220.0060.00916.84
7.0.210.0040.01016.45
7.0.200.0030.01316.28
7.0.190.0040.00816.41
7.0.180.0100.00416.32
7.0.170.0070.00616.24
7.0.160.0070.00416.24
7.0.150.0050.01016.21
7.0.140.0060.01016.31
7.0.130.0060.00816.39
7.0.120.0060.00616.40
7.0.110.0060.00816.39
7.0.100.0060.00916.24
7.0.90.0070.00516.23
7.0.80.0010.01116.25
7.0.70.0020.01316.31
7.0.60.0060.00716.25
7.0.50.0060.00916.42
7.0.40.0060.00714.97
7.0.30.0080.00614.95
7.0.20.0050.01015.02
7.0.10.0030.01015.01
7.0.00.0060.00715.01
5.6.400.0030.01114.92
5.6.390.0040.00915.03
5.6.380.0090.00515.01
5.6.370.0050.00815.17
5.6.360.0020.01115.08
5.6.350.0090.00415.28
5.6.340.0020.01115.31
5.6.330.0050.01115.14
5.6.320.0030.00815.17
5.6.310.0090.00715.15
5.6.300.0090.00915.15
5.6.290.0070.00815.03
5.6.280.0080.00715.29
5.6.270.0050.00615.21
5.6.260.0070.00915.25
5.6.250.0050.00815.08
5.6.240.0040.00514.98
5.6.230.0070.00515.19
5.6.220.0080.00814.95
5.6.210.0030.01415.16
5.6.200.0050.00514.90
5.6.190.0040.01115.16
5.6.180.0050.00615.13
5.6.170.0030.01215.05
5.6.160.0080.00415.18
5.6.150.0070.00514.93
5.6.140.0060.00815.23
5.6.130.0040.00815.09
5.6.120.0050.01015.27
5.6.110.0070.00715.10
5.6.100.0050.00915.00
5.6.90.0020.01514.83
5.6.80.0080.00615.16
5.6.70.0070.00714.98
5.6.60.0020.01114.95
5.6.50.0100.00815.02
5.6.40.0080.00615.04
5.6.30.0070.00815.02
5.6.20.0050.00714.97
5.6.10.0020.00815.01
5.6.00.0030.01015.09

preferences:
29.2 ms | 401 KiB | 5 Q