3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { function __construct() { $this->arr = array(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.0090.00618.43
8.3.50.0070.00716.75
8.3.40.0100.01018.79
8.3.30.0040.01118.79
8.3.20.0000.00720.39
8.3.10.0000.00823.71
8.3.00.0030.00623.66
8.2.180.0040.01116.75
8.2.170.0040.01122.96
8.2.160.0090.00420.47
8.2.150.0050.00324.18
8.2.140.0080.00024.66
8.2.130.0040.00421.02
8.2.120.0070.01126.35
8.2.110.0070.00321.18
8.2.100.0080.00417.93
8.2.90.0030.00519.26
8.2.80.0040.00417.97
8.2.70.0040.00417.63
8.2.60.0000.00818.04
8.2.50.0040.00418.09
8.2.40.0050.00320.41
8.2.30.0040.00419.52
8.2.20.0080.00017.71
8.2.10.0050.00218.02
8.2.00.0000.00818.05
8.1.280.0070.00725.92
8.1.270.0050.00322.02
8.1.260.0040.00428.09
8.1.250.0040.00428.09
8.1.240.0080.00321.03
8.1.230.0040.00817.71
8.1.220.0000.00817.77
8.1.210.0050.00318.77
8.1.200.0060.00317.35
8.1.190.0090.00017.36
8.1.180.0000.00918.10
8.1.170.0040.00418.46
8.1.160.0000.00720.79
8.1.150.0040.00420.77
8.1.140.0040.00419.60
8.1.130.0030.00317.77
8.1.120.0000.00717.51
8.1.110.0040.00417.38
8.1.100.0080.00017.44
8.1.90.0050.00317.40
8.1.80.0070.00417.45
8.1.70.0080.00017.48
8.1.60.0020.00517.50
8.1.50.0030.00517.47
8.1.40.0090.00317.53
8.1.30.0070.00017.72
8.1.20.0000.00717.68
8.1.10.0040.00417.61
8.1.00.0040.00417.50
8.0.300.0070.00018.77
8.0.290.0000.00716.75
8.0.280.0030.00318.34
8.0.270.0000.00817.22
8.0.260.0030.00317.23
8.0.250.0070.00016.97
8.0.240.0060.00316.94
8.0.230.0000.00716.96
8.0.220.0000.00816.95
8.0.210.0070.00016.88
8.0.200.0070.00017.02
8.0.190.0000.00917.04
8.0.180.0040.00416.93
8.0.170.0040.00416.93
8.0.160.0000.00717.09
8.0.150.0070.00016.97
8.0.140.0040.00416.95
8.0.130.0000.00513.39
8.0.120.0080.00016.87
8.0.110.0040.00416.88
8.0.100.0050.00216.87
8.0.90.0000.00717.00
8.0.80.0100.00516.97
8.0.70.0070.00016.79
8.0.60.0040.00416.83
8.0.50.0020.00516.98
8.0.30.0110.00817.29
8.0.20.0140.00817.40
8.0.10.0080.00316.95
8.0.00.0110.00716.76
7.4.330.0030.00315.08
7.4.320.0000.00716.48
7.4.300.0000.00816.62
7.4.290.0060.00316.61
7.4.280.0000.01016.45
7.4.270.0020.00516.67
7.4.260.0000.00716.59
7.4.250.0030.00516.49
7.4.240.0030.00316.63
7.4.230.0030.00316.38
7.4.220.0140.01016.71
7.4.210.0080.01116.65
7.4.200.0040.00416.52
7.4.160.0100.00716.71
7.4.150.0090.00917.40
7.4.140.0080.01417.86
7.4.130.0110.00616.50
7.4.120.0070.01216.58
7.4.110.0030.01516.81
7.4.100.0110.00716.57
7.4.90.0080.00816.41
7.4.80.0080.01019.39
7.4.70.0150.00616.63
7.4.60.0040.01216.74
7.4.50.0070.01016.29
7.4.40.0070.01416.59
7.4.30.0090.01516.55
7.4.10.0040.01114.81
7.4.00.0080.00914.91
7.3.330.0050.00013.45
7.3.320.0030.00313.40
7.3.310.0070.00016.34
7.3.300.0000.00716.31
7.3.290.0060.00316.31
7.3.280.0090.00916.41
7.3.270.0140.00717.40
7.3.260.0160.00616.45
7.3.250.0090.01116.55
7.3.240.0100.00916.60
7.3.230.0120.00916.39
7.3.210.0060.01016.49
7.3.200.0070.01019.39
7.3.190.0140.00416.72
7.3.180.0060.01216.52
7.3.170.0080.01216.34
7.3.160.0040.01516.51
7.3.130.0140.00314.58
7.3.120.0070.00714.87
7.3.110.0120.00614.65
7.3.100.0070.00714.84
7.3.90.0030.01015.17
7.3.80.0070.00714.92
7.3.70.0100.00314.76
7.3.60.0040.00715.03
7.3.50.0040.00714.91
7.3.40.0060.00314.59
7.3.30.0030.01014.69
7.3.20.0070.00716.64
7.3.10.0100.00316.85
7.3.00.0090.00016.44
7.2.330.0140.00516.82
7.2.320.0000.01816.78
7.2.310.0160.00716.71
7.2.300.0100.00616.62
7.2.290.0090.00916.62
7.2.260.0030.01415.22
7.2.250.0070.01015.28
7.2.240.0030.01314.61
7.2.230.0090.00615.03
7.2.220.0090.00615.29
7.2.210.0060.00915.24
7.2.200.0000.01115.09
7.2.190.0030.00815.11
7.2.180.0030.01015.23
7.2.170.0030.00615.15
7.2.160.0060.00615.23
7.2.150.0120.00317.03
7.2.140.0030.00717.06
7.2.130.0000.00916.89
7.2.120.0030.01316.97
7.2.110.0060.00917.06
7.2.100.0110.00816.98
7.2.90.0040.00816.77
7.2.80.0070.00717.22
7.2.70.0070.00716.71
7.2.60.0070.00816.90
7.2.50.0000.01117.12
7.2.40.0070.00716.77
7.2.30.0070.00717.04
7.2.20.0090.00917.08
7.2.10.0100.00717.05
7.2.00.0040.00918.34
7.1.330.0000.01416.00
7.1.320.0030.01215.76
7.1.310.0090.00615.71
7.1.300.0090.00615.87
7.1.290.0000.00915.62
7.1.280.0040.01115.69
7.1.270.0080.00415.89
7.1.260.0030.01015.79
7.1.250.0070.00415.70
7.1.240.0120.00815.89
7.1.230.0070.00715.85
7.1.220.0030.00915.97
7.1.210.0030.01015.91
7.1.200.0070.00815.72
7.1.190.0030.00915.94
7.1.180.0030.01015.67
7.1.170.0100.00315.96
7.1.160.0100.00315.86
7.1.150.0070.00715.76
7.1.140.0030.01215.93
7.1.130.0100.00315.76
7.1.120.0050.00315.85
7.1.110.0000.01215.86
7.1.100.0070.01017.02
7.1.90.0030.00915.72
7.1.80.0000.01315.72
7.1.70.0020.00816.45
7.1.60.0100.01217.47
7.1.50.0100.01425.17
7.1.40.0040.01115.80
7.1.30.0070.00715.83
7.1.20.0060.00915.77
7.1.10.0000.00915.77
7.1.00.0020.04619.13
7.0.330.0000.01115.31
7.0.320.0030.01415.34
7.0.310.0040.00415.26
7.0.300.0070.00315.48
7.0.290.0120.00315.58
7.0.280.0100.00015.49
7.0.270.0070.00715.45
7.0.260.0090.00415.44
7.0.250.0040.00415.48
7.0.240.0000.00815.50
7.0.230.0090.00615.14
7.0.220.0080.00515.64
7.0.210.0000.01915.31
7.0.200.0050.00715.96
7.0.190.0030.01315.28
7.0.180.0120.00615.21
7.0.170.0030.01315.55
7.0.160.0060.00615.21
7.0.150.0030.01215.46
7.0.140.0090.00315.43
7.0.130.0040.00815.46
7.0.120.0070.00415.59
7.0.110.0060.00615.51
7.0.100.0030.00915.41
7.0.90.0040.01115.19
7.0.80.0100.00015.58
7.0.70.0030.00715.59
7.0.60.0150.04218.65
7.0.50.0050.02416.73
7.0.40.0030.04616.81
7.0.30.0190.02716.91
7.0.20.0210.03816.78
7.0.10.0130.04316.84
7.0.00.0060.04916.98
5.6.400.0040.01114.40
5.6.390.0100.00714.18
5.6.380.0070.00314.45
5.6.370.0080.00414.57
5.6.360.0100.00314.58
5.6.350.0040.00914.51
5.6.340.0070.00714.10
5.6.330.0070.00714.38
5.6.320.0000.00914.69
5.6.310.0100.00714.58
5.6.300.0060.00914.55
5.6.290.0000.01014.66
5.6.280.0030.02217.86
5.6.270.0090.00614.39
5.6.260.0060.00914.46
5.6.250.0120.00314.36
5.6.240.0100.00614.45
5.6.230.0060.00314.73
5.6.220.0060.00614.58
5.6.210.0050.02517.53
5.6.200.0080.02316.27
5.6.190.0100.04017.47
5.6.180.0170.03717.52
5.6.170.0120.02717.29
5.6.160.0060.04717.44
5.6.150.0110.02816.46
5.6.140.0080.04016.37
5.6.130.0070.03016.20
5.6.120.0070.04217.77
5.6.110.0050.04517.82
5.6.100.0080.04517.71
5.6.90.0090.04717.75
5.6.80.0130.03217.43
5.6.70.0070.00714.50
5.6.60.0110.00414.06
5.6.50.0040.00814.31
5.6.40.0030.01014.34
5.6.30.0060.00614.52
5.6.20.0000.01514.30
5.6.10.0040.00814.57
5.6.00.0070.01014.42
5.5.380.0030.00714.43
5.5.370.0000.01414.57
5.5.360.0060.00314.35
5.5.350.2180.02317.48
5.5.340.0070.02816.32
5.5.330.0090.02517.45
5.5.320.0280.02817.51
5.5.310.0220.03817.20
5.5.300.0050.03316.35
5.5.290.0050.02716.28
5.5.280.0020.05017.74
5.5.270.0090.04417.70
5.5.260.0120.02517.62
5.5.250.0040.04317.39
5.5.240.0130.04217.48
5.5.230.0000.00914.52
5.5.220.0070.00714.45
5.5.210.0030.01014.36
5.5.200.0060.00614.51
5.5.190.0080.00314.35
5.5.180.0060.00914.32
5.5.170.0070.00714.53
5.5.160.0060.00914.38
5.5.150.0040.00714.26
5.5.140.0130.00014.62
5.5.130.0090.00614.62
5.5.120.0100.00714.48
5.5.110.0040.01214.05
5.5.100.0030.00514.20
5.5.90.0040.01114.50
5.5.80.0040.00414.39
5.5.70.0030.01314.64
5.5.60.0070.00714.32
5.5.50.0070.01014.54
5.5.40.0110.00714.48
5.5.30.0040.01214.51
5.5.20.0030.00614.25
5.5.10.0030.00614.36
5.5.00.0060.00614.13

preferences:
49.61 ms | 401 KiB | 5 Q