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.0060.00918.30
8.3.50.0120.00622.09
8.3.40.0150.00318.82
8.3.30.0040.01119.21
8.3.20.0070.00020.21
8.3.10.0080.00023.48
8.3.00.0050.00319.51
8.2.180.0040.01116.63
8.2.170.0070.00722.96
8.2.160.0070.00720.46
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0040.00422.17
8.2.110.0060.00320.52
8.2.100.0070.00418.22
8.2.90.0050.00319.09
8.2.80.0040.00417.97
8.2.70.0040.00417.50
8.2.60.0030.01017.93
8.2.50.0000.00818.07
8.2.40.0060.00319.71
8.2.30.0000.00918.12
8.2.20.0090.00017.78
8.2.10.0050.00318.20
8.2.00.0080.00017.72
8.1.280.0160.00325.92
8.1.270.0030.00623.79
8.1.260.0050.00326.35
8.1.250.0040.00428.09
8.1.240.0060.00322.05
8.1.230.0140.00019.48
8.1.220.0000.00917.74
8.1.210.0040.00418.77
8.1.200.0060.00317.36
8.1.190.0030.00717.13
8.1.180.0030.00618.10
8.1.170.0000.01118.64
8.1.160.0070.00321.91
8.1.150.0040.00418.88
8.1.140.0000.00817.38
8.1.130.0050.00317.91
8.1.120.0040.00417.38
8.1.110.0060.00317.39
8.1.100.0040.00417.39
8.1.90.0020.00517.37
8.1.80.0040.00417.41
8.1.70.0000.00717.39
8.1.60.0070.00017.63
8.1.50.0070.00017.53
8.1.40.0020.00517.54
8.1.30.0040.00417.61
8.1.20.0040.00417.63
8.1.10.0060.00317.61
8.1.00.0030.00517.55
8.0.300.0040.00418.77
8.0.290.0000.00716.63
8.0.280.0000.00718.46
8.0.270.0070.00017.24
8.0.260.0020.00517.29
8.0.250.0030.00316.96
8.0.240.0080.00016.99
8.0.230.0030.00316.87
8.0.220.0030.00316.94
8.0.210.0000.00616.95
8.0.200.0000.00716.85
8.0.190.0000.00716.87
8.0.180.0000.00716.92
8.0.170.0000.00816.84
8.0.160.0040.00416.88
8.0.150.0000.00716.93
8.0.140.0070.00316.76
8.0.130.0000.00513.30
8.0.120.0000.00716.86
8.0.110.0040.00416.82
8.0.100.0000.00716.87
8.0.90.0000.00817.03
8.0.80.0070.01116.86
8.0.70.0050.00316.94
8.0.60.0000.00716.98
8.0.50.0070.00016.73
8.0.30.0120.00917.25
8.0.20.0090.00917.40
8.0.10.0040.00417.06
8.0.00.0100.01116.82
7.4.330.0020.00315.09
7.4.320.0000.00716.63
7.4.300.0060.00016.49
7.4.290.0030.00316.44
7.4.280.0040.00416.46
7.4.270.0030.00316.53
7.4.260.0080.00016.67
7.4.250.0050.00316.61
7.4.240.0040.00416.65
7.4.230.0020.00516.61
7.4.220.0060.01216.74
7.4.210.0060.00916.58
7.4.200.0080.00016.45
7.4.160.0120.00416.62
7.4.150.0070.01117.40
7.4.140.0070.01217.86
7.4.130.0140.00816.47
7.4.120.0090.00816.46
7.4.110.0090.01216.62
7.4.100.0090.00916.52
7.4.90.0040.01416.50
7.4.80.0110.00519.39
7.4.70.0090.00916.51
7.4.60.0130.01016.56
7.4.50.0030.00316.40
7.4.40.0100.00716.54
7.4.30.0060.01016.41
7.4.00.0100.00314.94
7.3.330.0030.00313.39
7.3.320.0030.00313.36
7.3.310.0030.00316.34
7.3.300.0070.00016.36
7.3.290.0090.00816.33
7.3.280.0080.00816.40
7.3.270.0090.00917.40
7.3.260.0140.01016.41
7.3.250.0060.01116.56
7.3.240.0100.00816.52
7.3.230.0110.00716.59
7.3.210.0140.00416.54
7.3.200.0030.01319.39
7.3.190.0060.01216.55
7.3.180.0100.00616.32
7.3.170.0130.00316.43
7.3.160.0130.01016.40
7.3.120.0030.01414.55
7.3.110.0000.01715.18
7.3.100.0040.01114.90
7.3.90.0070.01014.86
7.3.80.0050.00515.19
7.3.70.0030.00714.89
7.3.60.0060.01014.78
7.3.50.0120.00314.79
7.3.40.0060.00314.96
7.3.30.0100.00714.80
7.3.20.0040.01116.46
7.3.10.0090.00316.70
7.3.00.0050.00516.67
7.2.330.0090.00916.84
7.2.320.0060.01116.63
7.2.310.0130.00316.80
7.2.300.0040.01216.67
7.2.290.0150.00416.77
7.2.250.0000.01715.31
7.2.240.0130.00315.16
7.2.230.0140.00015.34
7.2.220.0110.00714.83
7.2.210.0040.01115.09
7.2.200.0060.00315.11
7.2.190.0120.00415.11
7.2.180.0000.01114.86
7.2.170.0100.00715.11
7.2.110.0140.01016.26
7.2.00.0130.00319.37
7.1.330.0090.00315.80
7.1.320.0070.00715.88
7.1.310.0070.00715.80
7.1.300.0030.01315.56
7.1.290.0070.00715.59
7.1.280.0030.01015.87
7.1.270.0030.01015.95
7.1.260.0040.00715.73
7.1.100.0030.01017.99
7.1.70.0040.01117.29
7.1.60.0110.01419.32
7.1.50.0170.00017.02
7.1.00.0000.08022.45
7.0.200.0000.00916.55
7.0.140.0100.07022.00
7.0.100.0030.08719.96
7.0.90.0100.05319.95
7.0.80.0070.04319.86
7.0.70.0130.06019.88
7.0.60.0070.04019.95
7.0.50.0200.06020.17
7.0.40.0130.06020.14
7.0.30.0070.05720.17
7.0.20.0030.07719.95
7.0.10.0200.06719.98
7.0.00.0100.05020.13
5.6.280.0000.07021.04
5.6.250.0030.04720.76
5.6.240.0130.05020.77
5.6.230.0030.04320.61
5.6.220.0100.04020.75
5.6.210.0130.03320.66
5.6.200.0130.07321.14
5.6.190.0030.07720.96
5.6.180.0100.08021.12
5.6.170.0030.08021.01
5.6.160.0100.07321.11
5.6.150.0100.06320.97
5.6.140.0070.07021.03
5.6.130.0070.04320.94
5.6.120.0070.07721.05
5.6.110.0070.08021.13
5.6.100.0070.08320.98
5.6.90.0030.08721.16
5.6.80.0130.03320.44
5.6.70.0000.08020.32
5.6.60.0170.07720.49
5.6.50.0070.07320.41
5.6.40.0070.05320.25
5.6.30.0170.07020.45
5.6.20.0130.03720.31
5.6.10.0100.08020.41
5.6.00.0070.08720.29
5.5.380.0100.08320.38
5.5.370.0100.03720.46
5.5.360.0070.09020.37
5.5.350.0100.05720.37
5.5.340.0100.05720.83
5.5.330.0100.08320.87
5.5.320.0070.07020.93
5.5.310.0100.04320.89
5.5.300.0100.04320.77
5.5.290.0030.04720.78
5.5.280.0100.07720.79
5.5.270.0100.08020.79
5.5.260.0100.08020.77
5.5.250.0030.07020.57
5.5.240.0070.06320.13
5.5.230.0030.08320.27
5.5.220.0100.08020.21
5.5.210.0070.08020.26
5.5.200.0130.07320.15
5.5.190.0000.06020.19
5.5.180.0030.08020.21
5.5.160.0170.06720.26
5.5.150.0130.06720.21
5.5.140.0070.07020.23
5.5.130.0100.07320.23
5.5.120.0100.03320.04
5.5.110.0130.06020.13
5.5.100.0030.05020.14
5.5.90.0100.05720.12
5.5.80.0100.08020.13
5.5.70.0070.06020.08
5.5.60.0100.06320.06
5.5.50.0070.08020.11
5.5.40.0130.07720.16
5.5.30.0100.08020.15
5.5.20.0130.06719.94
5.5.10.0130.08720.08
5.5.00.0070.07020.04
5.4.450.0100.08019.26
5.4.440.0070.07019.36
5.4.430.0030.06319.36
5.4.420.0030.08719.20
5.4.410.0030.05319.34
5.4.400.0030.05319.04
5.4.390.0230.06719.21
5.4.380.0130.06719.12
5.4.370.0100.07018.90
5.4.360.0170.05019.18
5.4.350.0070.07718.90
5.4.340.0100.06719.12
5.4.320.0070.06318.90
5.4.310.0070.07019.21
5.4.300.0070.07319.23
5.4.290.0100.04719.16
5.4.280.0100.05019.04
5.4.270.0000.07019.15
5.4.260.0100.05319.13
5.4.250.0070.05319.17
5.4.240.0030.07019.22
5.4.230.0100.04719.13
5.4.220.0130.06719.02
5.4.210.0000.08319.11
5.4.200.0200.06319.12
5.4.190.0030.08019.01
5.4.180.0130.05718.86
5.4.170.0030.08319.13
5.4.160.0070.07319.16
5.4.150.0130.07018.98
5.4.140.0000.08716.33
5.4.130.0130.06316.42
5.4.120.0030.07316.25
5.4.110.0170.07016.56
5.4.100.0070.03716.58
5.4.90.0130.06716.39
5.4.80.0070.04716.51
5.4.70.0170.06316.36
5.4.60.0100.06016.47
5.4.50.0200.03016.46
5.4.40.0070.05016.51
5.4.30.0170.06716.50
5.4.20.0100.06716.33
5.4.10.0170.04716.33
5.4.00.0070.05715.81
5.3.290.0030.07014.57
5.3.280.0100.07014.57
5.3.270.0130.06014.60
5.3.260.0070.05314.63
5.3.250.0230.05714.65
5.3.240.0030.08314.57
5.3.230.0070.06314.73
5.3.220.0230.06014.62
5.3.210.0100.06714.56
5.3.200.0130.06314.61
5.3.190.0030.04314.65
5.3.180.0100.06714.72
5.3.170.0070.06314.52
5.3.160.0130.05014.59
5.3.150.0070.07714.53
5.3.140.0030.05014.64
5.3.130.0070.07714.55
5.3.120.0030.07014.57
5.3.110.0030.04314.54
5.3.100.0070.07314.08
5.3.90.0070.04714.04
5.3.80.0000.05314.06
5.3.70.0130.04014.05
5.3.60.0100.07013.94
5.3.50.0100.06713.87
5.3.40.0100.06713.96
5.3.30.0030.07714.03
5.3.20.0030.07713.61
5.3.10.0100.05313.79
5.3.00.0030.05313.76
5.2.170.0030.06712.61
5.2.160.0030.06312.61
5.2.150.0070.06012.61
5.2.140.0000.04012.61
5.2.130.0030.05312.61
5.2.120.0100.06012.61
5.2.110.0100.05712.61
5.2.100.0070.05312.61
5.2.90.0070.03312.61
5.2.80.0070.05312.61
5.2.70.0000.05712.61
5.2.60.0100.06312.61
5.2.50.0070.06012.61
5.2.40.0030.06712.61
5.2.30.0100.02712.61
5.2.20.0000.06012.61
5.2.10.0000.05712.61
5.2.00.0000.04712.61
5.1.60.0030.03312.61
5.1.50.0030.05012.61
5.1.40.0070.03712.61
5.1.30.0070.05712.61
5.1.20.0000.03012.61
5.1.10.0000.03012.61
5.1.00.0030.02712.61
5.0.50.0070.04312.61
5.0.40.0070.04012.61
5.0.30.0070.04312.61
5.0.20.0030.02712.61
5.0.10.0030.04312.61
5.0.00.0030.03712.61
4.4.90.0070.02012.61
4.4.80.0100.02712.61
4.4.70.0000.02312.61
4.4.60.0000.02712.61
4.4.50.0000.02312.61
4.4.40.0000.04012.61
4.4.30.0030.02312.61
4.4.20.0030.02712.61
4.4.10.0030.02712.61
4.4.00.0030.05012.61
4.3.110.0070.02712.61
4.3.100.0000.03312.61
4.3.90.0030.01712.61
4.3.80.0000.02712.61
4.3.70.0100.00712.61
4.3.60.0000.03712.61
4.3.50.0000.02312.61
4.3.40.0070.04012.61
4.3.30.0000.02312.61
4.3.20.0000.01712.61
4.3.10.0000.03012.61
4.3.00.0030.02712.61

preferences:
53.97 ms | 401 KiB | 5 Q