3v4l.org

run code in 300+ PHP versions simultaneously
<?php class GeoCoder { protected $latitude; protected $longitude; public $distance; public function __construct($lat,$long,$dist) { $this->latitude = $lat; $this->longitude = $long; $this->distance = $dist; } } $o1 = new GeoCoder(-22.43,-46.81,1500.00); $o2 = new GeoCoder(-22.42,-46.82,1740.00); $o3 = new GeoCoder(-21.43,-46.80,152.00); $array = array($o1, $o2, $o3); function quickSort( &$array ) { $cur = 1; $stack[1]['l'] = 0; $stack[1]['r'] = count($array)-1; do { $l = $stack[$cur]['l']; $r = $stack[$cur]['r']; $cur--; do { $i = $l; $j = $r; $tmp = $array[(int)( ($l+$r)/2 )]; // partion the array in two parts. // left from $tmp are with smaller values, // right from $tmp are with bigger ones do { while( $array[$i]->distance < $tmp->distance ) $i++; while( $tmp->distance < $array[$j]->distance ) $j--; // swap elements from the two sides if( $i <= $j) { $w = $array[$i]; $array[$i] = $array[$j]; $array[$j] = $w; $i++; $j--; } }while( $i <= $j ); if( $i < $r ) { $cur++; $stack[$cur]['l'] = $i; $stack[$cur]['r'] = $r; } $r = $j; }while( $l < $r ); }while( $cur != 0 ); } var_dump(quickSort($array));

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.0040.01118.56
8.3.50.0080.01021.85
8.3.40.0090.00919.02
8.3.30.0110.00419.17
8.3.20.0080.00020.28
8.3.10.0000.00823.65
8.3.00.0060.00319.26
8.2.180.0080.00616.63
8.2.170.0070.00722.96
8.2.160.0120.00320.39
8.2.150.0070.00024.18
8.2.140.0050.00324.66
8.2.130.0040.00426.16
8.2.120.0040.00422.07
8.2.110.0100.00021.09
8.2.100.0090.00317.91
8.2.90.0000.00819.40
8.2.80.0050.00317.97
8.2.70.0000.00817.75
8.2.60.0000.00817.93
8.2.50.0040.00418.07
8.2.40.0030.00620.07
8.2.30.0050.00318.09
8.2.20.0040.00417.66
8.2.10.0000.00818.09
8.2.00.0000.00817.89
8.1.280.0070.01125.92
8.1.270.0090.00623.84
8.1.260.0000.00826.35
8.1.250.0000.00828.09
8.1.240.0080.00022.14
8.1.230.0040.00818.86
8.1.220.0030.00517.79
8.1.210.0080.00018.77
8.1.200.0060.00317.35
8.1.190.0000.00817.23
8.1.180.0040.00418.10
8.1.170.0050.00320.43
8.1.160.0000.00822.09
8.1.150.0000.00718.90
8.1.140.0050.00217.41
8.1.130.0000.00717.89
8.1.120.0040.00417.40
8.1.110.0080.00017.36
8.1.100.0000.00817.48
8.1.90.0030.00517.37
8.1.80.0000.00817.47
8.1.70.0000.00717.39
8.1.60.0000.00917.64
8.1.50.0000.00917.47
8.1.40.0000.00717.55
8.1.30.0080.00017.74
8.1.20.0030.00617.59
8.1.10.0050.00317.61
8.1.00.0040.00417.42
8.0.300.0040.00420.09
8.0.290.0040.00416.63
8.0.280.0040.00418.35
8.0.270.0000.00717.25
8.0.260.0000.00717.26
8.0.250.0030.00516.98
8.0.240.0040.00416.98
8.0.230.0040.00416.97
8.0.220.0000.00716.79
8.0.210.0050.00316.83
8.0.200.0040.00417.03
8.0.190.0040.00416.93
8.0.180.0040.00416.84
8.0.170.0000.00816.94
8.0.160.0050.00216.91
8.0.150.0000.00716.84
8.0.140.0000.01116.82
8.0.130.0000.00513.37
8.0.120.0050.00316.78
8.0.110.0050.00216.84
8.0.100.0000.00716.93
8.0.90.0000.00716.76
8.0.80.0130.00916.95
8.0.70.0040.00416.70
8.0.60.0000.00716.70
8.0.50.0050.00216.79
8.0.30.0090.01217.15
8.0.20.0080.01217.40
8.0.10.0050.00316.97
8.0.00.0110.00716.97
7.4.330.0020.00215.02
7.4.320.0000.00616.44
7.4.300.0030.00316.62
7.4.290.0000.00716.64
7.4.280.0040.00416.54
7.4.270.0070.00016.53
7.4.260.0030.00316.43
7.4.250.0040.00416.40
7.4.240.0020.00516.60
7.4.230.0030.00316.65
7.4.220.0090.00916.57
7.4.210.0070.00716.59
7.4.200.0000.00916.38
7.4.160.0160.00016.68
7.4.150.0070.01017.40
7.4.140.0080.01417.86
7.4.130.0110.00816.63
7.4.120.0070.01016.55
7.4.110.0030.01816.54
7.4.100.0120.00616.67
7.4.90.0160.00316.63
7.4.80.0080.00819.39
7.4.70.0070.01416.46
7.4.60.0000.01616.66
7.4.50.0030.00316.40
7.4.40.0110.00616.51
7.4.30.0060.01516.36
7.4.00.0070.00714.84
7.3.330.0060.00013.25
7.3.320.0030.00313.21
7.3.310.0000.00716.45
7.3.300.0000.00716.46
7.3.290.0080.00816.36
7.3.280.0080.00916.38
7.3.270.0100.00717.40
7.3.260.0000.01716.68
7.3.250.0050.01116.51
7.3.240.0090.00916.52
7.3.230.0090.00916.43
7.3.210.0120.00616.65
7.3.200.0120.00419.39
7.3.190.0130.01016.43
7.3.180.0090.00616.36
7.3.170.0090.00616.54
7.3.160.0090.00916.63
7.2.330.0100.01016.65
7.2.320.0080.00916.66
7.2.310.0140.01016.84
7.2.300.0050.01116.78
7.2.290.0060.01216.81
7.2.00.0060.00919.62
7.1.100.0090.00318.36
7.1.70.0030.00917.35
7.1.60.0070.01719.32
7.1.50.0110.01417.04
7.1.00.0070.07322.36
7.0.200.0000.00716.73
7.0.140.0030.07322.21
7.0.60.0070.08019.95
7.0.50.0030.04017.72
7.0.40.0030.06720.11
7.0.30.0130.04720.06
7.0.20.0330.07020.15
7.0.10.0070.05020.15
7.0.00.0070.05020.05
5.6.280.0070.07021.11
5.6.210.0130.07320.78
5.6.200.0200.07018.20
5.6.190.0130.08020.38
5.6.180.0230.07020.58
5.6.170.0200.05720.54
5.6.160.0100.07320.55
5.6.150.0030.05018.19
5.6.140.0100.07318.29
5.6.130.0030.04018.19
5.6.120.0130.07721.06
5.6.110.0130.07720.98
5.6.100.0100.08020.98
5.6.90.0200.08320.89
5.6.80.0070.08020.45
5.6.70.4500.03020.28
5.5.350.0170.04320.44
5.5.340.0170.06717.96
5.5.330.0100.07720.27
5.5.320.0330.07320.25
5.5.310.0170.06020.34
5.5.300.0070.07717.98
5.5.290.0100.08018.08
5.5.280.0070.08320.98
5.5.270.0030.08320.78
5.5.260.0000.04320.99
5.5.250.0070.08320.59
5.5.240.3500.04320.38
5.4.450.0730.06319.31
5.4.440.0700.06319.70
5.4.430.0700.05719.47
5.4.420.0600.06319.57
5.4.410.0670.06719.35
5.4.400.0800.05019.13
5.4.390.0070.05719.02
5.4.380.0630.06319.26
5.4.370.0730.06319.23
5.4.360.0770.08719.01
5.4.350.0600.05719.26
5.4.340.0050.03412.03
5.4.320.0090.03212.52
5.4.310.0080.03412.52
5.4.300.0060.03512.52
5.4.290.0050.03712.52
5.4.280.0060.03412.41
5.4.270.0060.03512.41
5.4.260.0030.04012.41
5.4.250.0030.03912.42
5.4.240.0040.03712.41
5.4.230.0090.03512.41
5.4.220.0060.03912.40
5.4.210.0050.03412.40
5.4.200.0050.03612.40
5.4.190.0070.03412.41
5.4.180.0050.03612.40
5.4.170.0030.03812.41
5.4.160.0040.03612.41
5.4.150.0060.03612.40
5.4.140.0050.03712.08
5.4.130.0040.03612.07
5.4.120.0060.03412.03
5.4.110.0060.03312.03
5.4.100.0050.03512.03
5.4.90.0030.03912.03
5.4.80.0070.03412.03
5.4.70.0030.03612.03
5.4.60.0060.03312.03
5.4.50.0040.03612.02
5.4.40.0050.03412.01
5.4.30.0070.03412.00
5.4.20.0060.03412.01
5.4.10.0060.03412.01
5.4.00.0080.03311.50
5.3.290.0090.03612.80
5.3.280.0070.03912.71
5.3.270.0100.03712.72
5.3.260.0060.03812.72
5.3.250.0060.03612.72
5.3.240.0050.03712.72
5.3.230.0050.03912.71
5.3.220.0060.03612.68
5.3.210.0050.03912.68
5.3.200.0070.03412.68
5.3.190.0050.03812.68
5.3.180.0060.03712.68
5.3.170.0090.03612.67
5.3.160.0050.04012.68
5.3.150.0090.03912.68
5.3.140.0090.03512.66
5.3.130.0070.04112.66
5.3.120.0040.04112.66
5.3.110.0060.04312.66
5.3.100.0100.03712.13
5.3.90.0070.05112.12
5.3.80.0080.03512.11
5.3.70.0050.03912.11
5.3.60.0040.03812.09
5.3.50.0080.03312.04
5.3.40.0060.03512.04
5.3.30.0070.03312.00
5.3.20.0070.03311.78
5.3.10.0050.03511.75
5.3.00.0030.03811.73
5.2.170.0040.0329.23
5.2.160.0060.0279.23
5.2.150.0050.0299.23
5.2.140.0030.0309.23
5.2.130.0030.0299.19
5.2.120.0030.0309.19
5.2.110.0050.0299.20
5.2.100.0080.0249.19
5.2.90.0040.0339.20
5.2.80.0030.0329.19
5.2.70.0050.0339.19
5.2.60.0040.0349.14
5.2.50.0060.0309.11
5.2.40.0050.0279.09
5.2.30.0040.0299.07
5.2.20.0070.0259.05
5.2.10.0040.0278.96
5.2.00.0070.0318.82
5.1.60.0090.0198.10
5.1.50.0030.0258.10
5.1.40.0020.0268.08
5.1.30.0030.0268.43
5.1.20.0040.0258.45
5.1.10.0020.0278.18
5.1.00.0040.0258.19
5.0.50.0050.0196.66
5.0.40.0030.0206.52
5.0.30.0000.0346.34
5.0.20.0050.0176.33
5.0.10.0030.0206.30
5.0.00.0030.0316.30
4.4.90.0020.0164.77
4.4.80.0050.0134.76
4.4.70.0020.0164.75
4.4.60.0040.0144.76
4.4.50.0040.0144.77
4.4.40.0000.0284.71
4.4.30.0030.0154.76
4.4.20.0030.0154.84
4.4.10.0030.0154.85
4.4.00.0030.0254.76
4.3.110.0020.0164.67
4.3.100.0050.0144.66
4.3.90.0030.0154.63
4.3.80.0030.0244.59
4.3.70.0010.0164.63
4.3.60.0010.0164.63
4.3.50.0030.0154.63
4.3.40.0020.0254.54
4.3.30.0020.0163.30
4.3.20.0020.0163.28
4.3.10.0020.0163.24
4.3.00.0130.0206.78

preferences:
51.06 ms | 401 KiB | 5 Q