3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { function __construct() { $this->arr = [1,34,3,98,9,76,45,4]; } function joinNumbers($a, $b) { $t=10; while($b>=$t) $t*=10; return $a*$t+$b; } function arrangeNumbers() { $size=count($this->arr)/count($this->arr[0]); for($i=0;$i<$size-1;$i++) { for($j=$i+1;$j<$size;$j++) { if($this->joinNumbers($this->arr[$i],$this->arr[$j])<$this->joinNumbers($this->arr[$j],$this->arr[$i])) { $temp = $this->arr[$i]; $this->arr[$i] = $this->arr[$j]; $this->arr[$j] = $this->arr[$i]; } } } printf("Number is : "); for($i=0;$i<$size;$i++) { printf("%d",$this->arr[$i]); } printf("\n\n"); } } $test = new A; $test->arrangeNumbers();

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.60.0030.01218.61
8.3.50.0110.00416.30
8.3.40.0150.00618.82
8.3.30.0000.01518.91
8.3.20.0000.00720.34
8.3.10.0060.00323.66
8.3.00.0080.00023.65
8.2.180.0090.00618.66
8.2.170.0110.00422.96
8.2.160.0070.00720.52
8.2.150.0000.00824.18
8.2.140.0040.00424.66
8.2.130.0050.00320.92
8.2.120.0070.00026.35
8.2.110.0030.00621.00
8.2.100.0040.00717.84
8.2.90.0080.00017.84
8.2.80.0080.00018.02
8.2.70.0060.00317.59
8.2.60.0090.00018.03
8.2.50.0030.00618.09
8.2.40.0000.00820.47
8.2.30.0050.00319.60
8.2.20.0000.00717.75
8.2.10.0000.00718.06
8.2.00.0000.00918.11
8.1.280.0070.00725.92
8.1.270.0060.00322.06
8.1.260.0050.00328.09
8.1.250.0060.00328.09
8.1.240.0000.00922.48
8.1.230.0040.00720.96
8.1.220.0060.00317.74
8.1.210.0000.00818.88
8.1.200.0060.00317.35
8.1.190.0080.00017.35
8.1.180.0030.00518.10
8.1.170.0000.00818.56
8.1.160.0070.00020.70
8.1.150.0000.00720.59
8.1.140.0000.00819.47
8.1.130.0000.00717.73
8.1.120.0000.00817.48
8.1.110.0040.00417.38
8.1.100.0040.00417.47
8.1.90.0040.00417.52
8.1.80.0040.00817.45
8.1.70.0000.00817.50
8.1.60.0070.00017.65
8.1.50.0030.00617.60
8.1.40.0060.00617.55
8.1.30.0040.00417.68
8.1.20.0080.00017.61
8.1.10.0000.00817.56
8.1.00.0040.00417.53
8.0.300.0000.00719.94
8.0.290.0000.00716.75
8.0.280.0070.00018.32
8.0.270.0030.00517.21
8.0.260.0000.00717.12
8.0.250.0030.00316.97
8.0.240.0080.00016.95
8.0.230.0040.00416.84
8.0.220.0030.00316.79
8.0.210.0080.00016.80
8.0.200.0000.00717.04
8.0.190.0080.00316.91
8.0.180.0040.00416.99
8.0.170.0000.00716.92
8.0.160.0000.00717.00
8.0.150.0000.00816.75
8.0.140.0000.00716.98
8.0.130.0000.00613.32
8.0.120.0080.00016.86
8.0.110.0040.00417.02
8.0.100.0040.00417.04
8.0.90.0040.00416.96
8.0.80.0080.00616.94
8.0.70.0040.00416.97
8.0.60.0000.00716.95
8.0.50.0070.00016.98
8.0.30.0100.00517.03
8.0.20.0110.00917.40
8.0.10.0060.00317.10
8.0.00.0100.01116.79
7.4.330.0070.00015.08
7.4.320.0030.00316.58
7.4.300.0040.00416.54
7.4.290.0060.00316.59
7.4.280.0070.00316.50
7.4.270.0000.00716.53
7.4.260.0000.00716.65
7.4.250.0050.00316.56
7.4.240.0000.00816.63
7.4.230.0000.00716.43
7.4.220.0120.00916.65
7.4.210.0080.00816.68
7.4.200.0000.00716.71
7.4.160.0080.00816.44
7.4.150.0090.00917.40
7.4.140.0150.00717.86
7.4.130.0050.01316.66
7.4.120.0090.00916.56
7.4.110.0090.00916.74
7.4.100.0140.00716.61
7.4.90.0060.01316.73
7.4.80.0190.00319.39
7.4.70.0080.01116.50
7.4.60.0130.00316.62
7.4.50.0040.00816.14
7.4.40.0190.00316.48
7.4.30.0090.01416.52
7.4.10.0030.01615.14
7.4.00.0080.00815.03
7.3.330.0050.00013.22
7.3.320.0000.00513.44
7.3.310.0070.00016.54
7.3.300.0000.00716.45
7.3.290.0070.00016.48
7.3.280.0110.00516.42
7.3.270.0110.00617.40
7.3.260.0040.01616.34
7.3.250.0120.00616.45
7.3.240.0090.01016.54
7.3.230.0090.00916.39
7.3.210.0090.00616.48
7.3.200.0170.00319.39
7.3.190.0130.01016.39
7.3.180.0030.01316.45
7.3.170.0100.00716.51
7.3.160.0060.00916.35
7.3.130.0030.01514.92
7.3.120.0080.00914.94
7.3.110.0080.00914.95
7.3.100.0060.00914.87
7.3.90.0040.00914.75
7.3.80.0030.01214.76
7.3.70.0070.00714.86
7.3.60.0040.00914.86
7.3.50.0100.00414.97
7.3.40.0060.00514.95
7.3.30.0000.01014.59
7.3.20.0070.00816.67
7.3.10.0070.00516.80
7.3.00.0020.01016.80
7.2.330.0070.01116.53
7.2.320.0090.00916.80
7.2.310.0040.01316.87
7.2.300.0090.00916.66
7.2.290.0140.00716.79
7.2.260.0100.00714.79
7.2.250.0080.00915.04
7.2.240.0030.01215.19
7.2.230.0070.00714.92
7.2.220.0060.00914.91
7.2.210.0050.01215.27
7.2.200.0090.00615.00
7.2.190.0060.00814.86
7.2.180.0020.01115.08
7.2.170.0040.01215.21
7.2.160.0080.00814.97
7.2.150.0120.00416.94
7.2.140.0070.01016.90
7.2.130.0140.00016.99
7.2.120.0100.00317.01
7.2.110.0070.01116.68
7.2.100.0100.00717.11
7.2.90.0120.00417.18
7.2.80.0030.00616.90
7.2.70.0060.01017.06
7.2.60.0100.00316.91
7.2.50.0030.01316.88
7.2.40.0030.01017.00
7.2.30.0070.00717.08
7.2.20.0080.00316.98
7.2.10.0080.00616.70
7.2.00.0030.01018.33
7.1.330.0060.00815.73
7.1.320.0030.01215.92
7.1.310.0080.01015.82
7.1.300.0100.00715.85
7.1.290.0050.00815.92
7.1.280.0060.00615.83
7.1.270.0020.01015.80
7.1.260.0020.01215.73
7.1.250.0000.01515.89
7.1.240.0070.01015.77
7.1.230.0070.00715.65
7.1.220.0080.00815.52
7.1.210.0000.01515.86
7.1.200.0050.00615.87
7.1.190.0000.01115.98
7.1.180.0060.00615.64
7.1.170.0090.00315.89
7.1.160.0060.00615.57
7.1.150.0000.01615.45
7.1.140.0070.00715.90
7.1.130.0000.00815.82
7.1.120.0000.01315.95
7.1.110.0040.00815.71
7.1.100.0130.00616.85
7.1.90.0080.00415.80
7.1.80.0030.00915.90
7.1.70.0040.00616.54
7.1.60.0080.00917.69
7.1.50.0050.01116.39
7.1.40.0000.01315.85
7.1.30.0040.01115.81
7.1.20.0090.00615.74
7.1.10.0040.00815.93
7.1.00.0090.03518.97
7.0.330.0090.00615.52
7.0.320.0080.00415.22
7.0.310.0030.00715.41
7.0.300.0130.00015.47
7.0.290.0030.00615.15
7.0.280.0080.00415.43
7.0.270.0030.00615.48
7.0.260.0040.00415.57
7.0.250.0070.00715.29
7.0.240.0040.01415.54
7.0.230.0000.01615.57
7.0.220.0000.01115.33
7.0.210.0070.00715.68
7.0.200.0050.00516.19
7.0.190.0030.00615.61
7.0.180.0000.01315.28
7.0.170.0040.00815.63
7.0.160.0100.00015.29
7.0.150.0050.00315.42
7.0.140.0060.00315.55
7.0.130.0100.00015.19
7.0.120.0040.01115.29
7.0.110.0030.01015.32
7.0.100.0060.00615.48
7.0.90.0030.01415.14
7.0.80.0000.01115.17
7.0.70.0050.00815.63
7.0.60.0150.03818.48
7.0.50.0120.01716.62
7.0.40.0070.02517.04
7.0.30.0170.04016.72
7.0.20.0120.02916.89
7.0.10.0070.03716.77
7.0.00.0040.04716.72
5.6.400.0060.00614.52
5.6.390.0030.01214.52
5.6.380.0070.00714.23
5.6.370.0030.01014.69
5.6.360.0030.01214.17
5.6.350.0060.00614.57
5.6.340.0050.00814.30
5.6.330.0040.00814.48
5.6.320.0060.01214.60
5.6.310.0090.00614.68
5.6.300.0000.01314.54
5.6.290.0000.01414.56
5.6.280.0070.02217.58
5.6.270.0030.00614.50
5.6.260.0100.00314.39
5.6.250.0090.00614.67
5.6.240.0070.01114.35
5.6.230.0040.00714.52
5.6.220.0100.00514.57
5.6.210.0040.02617.47
5.6.200.0090.04116.42
5.6.190.0030.04017.47
5.6.180.0170.03417.50
5.6.170.0130.02117.43
5.6.160.0070.04817.47
5.6.150.0050.04316.49
5.6.140.0110.03816.37
5.6.130.0050.03316.29
5.6.120.0050.02717.71
5.6.110.0100.03817.78
5.6.100.0070.04517.79
5.6.90.0050.04817.79
5.6.80.0070.05017.36
5.6.70.0030.01314.30
5.6.60.0000.01714.63
5.6.50.0030.01014.38
5.6.40.0070.00714.47
5.6.30.0070.01014.48
5.6.20.0120.00614.71
5.6.10.0070.00314.36
5.6.00.0030.01014.37
5.5.380.0000.01114.40
5.5.370.0060.00914.66
5.5.360.0000.01214.29
5.5.350.2080.02217.40
5.5.340.0050.04516.12
5.5.330.0060.04317.38
5.5.320.0260.03317.30
5.5.310.0130.04217.28
5.5.300.0100.03516.41
5.5.290.0080.05016.21
5.5.280.0040.03417.62
5.5.270.0110.04217.65
5.5.260.0080.04017.48
5.5.250.0100.04517.51
5.5.240.0130.04317.20
5.5.230.0110.00414.38
5.5.220.0070.00714.11
5.5.210.0060.00914.39
5.5.200.0070.00314.33
5.5.190.0100.00614.57
5.5.180.0060.01014.32
5.5.170.0000.01414.35
5.5.160.0090.00614.27
5.5.150.0070.00714.32
5.5.140.0030.01314.27
5.5.130.0100.00314.30
5.5.120.0040.01414.52
5.5.110.0040.01114.43
5.5.100.0030.01314.64
5.5.90.0060.01314.01
5.5.80.0100.00314.13
5.5.70.0080.00414.45
5.5.60.0060.00614.34
5.5.50.0060.00614.29
5.5.40.0080.00414.23
5.5.30.0040.00814.39
5.5.20.0030.01014.15
5.5.10.0060.00314.53
5.5.00.0030.00714.39

preferences:
60.37 ms | 400 KiB | 5 Q