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 ); } quickSort($array); var_dump($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.0170.00318.43
8.3.50.0110.00921.98
8.3.40.0070.00718.98
8.3.30.0110.00419.27
8.3.20.0040.00420.34
8.3.10.0040.00423.46
8.3.00.0060.00319.25
8.2.180.0130.00718.17
8.2.170.0110.00422.96
8.2.160.0100.00720.52
8.2.150.0040.00424.18
8.2.140.0060.00324.66
8.2.130.0040.00426.16
8.2.120.0080.00021.95
8.2.110.0100.00021.11
8.2.100.0060.00617.97
8.2.90.0030.00519.17
8.2.80.0040.00417.97
8.2.70.0080.00017.75
8.2.60.0000.00818.05
8.2.50.0000.00818.07
8.2.40.0000.01119.94
8.2.30.0000.00818.14
8.2.20.0040.00417.71
8.2.10.0040.00418.06
8.2.00.0030.00517.84
8.1.280.0100.00725.92
8.1.270.0160.00023.72
8.1.260.0050.00326.35
8.1.250.0070.00028.09
8.1.240.0090.00022.09
8.1.230.0090.00618.85
8.1.220.0080.00017.74
8.1.210.0030.00518.77
8.1.200.0070.00317.35
8.1.190.0060.00317.35
8.1.180.0060.00318.10
8.1.170.0000.00820.50
8.1.160.0040.00421.91
8.1.150.0000.00718.79
8.1.140.0000.00717.54
8.1.130.0000.00717.88
8.1.120.0080.00017.45
8.1.110.0060.00317.51
8.1.100.0060.00317.32
8.1.90.0000.00817.38
8.1.80.0000.00717.45
8.1.70.0000.00817.43
8.1.60.0030.00617.64
8.1.50.0000.00817.51
8.1.40.0040.00417.54
8.1.30.0030.00517.75
8.1.20.0000.00917.58
8.1.10.0000.00817.48
8.1.00.0000.00817.54
8.0.300.0000.00720.09
8.0.290.0040.00416.75
8.0.280.0000.00718.38
8.0.270.0030.00317.28
8.0.260.0040.00417.29
8.0.250.0030.00316.94
8.0.240.0040.00416.94
8.0.230.0000.00716.98
8.0.220.0070.00016.80
8.0.210.0030.00316.91
8.0.200.0020.00516.88
8.0.190.0000.00917.00
8.0.180.0000.00716.96
8.0.170.0080.00016.99
8.0.160.0000.00716.93
8.0.150.0000.00716.83
8.0.140.0000.01016.88
8.0.130.0060.00013.23
8.0.120.0030.00516.73
8.0.110.0040.00416.78
8.0.100.0070.00016.86
8.0.90.0000.00816.93
8.0.80.0130.00316.93
8.0.70.0040.00416.93
8.0.60.0040.00416.79
8.0.50.0040.00416.91
8.0.30.0120.01216.93
8.0.20.0140.00817.40
8.0.10.0030.00517.09
8.0.00.0140.00816.93
7.4.330.0020.00215.09
7.4.320.0000.00716.41
7.4.300.0000.00716.54
7.4.290.0000.00716.63
7.4.280.0040.00716.55
7.4.270.0030.00316.57
7.4.260.0070.00016.48
7.4.250.0080.00016.51
7.4.240.0000.00716.51
7.4.230.0070.00016.47
7.4.220.0120.00616.57
7.4.210.0040.01416.61
7.4.200.0040.00416.73
7.4.160.0100.00716.36
7.4.150.0190.00017.40
7.4.140.0080.01417.86
7.4.130.0130.00516.51
7.4.120.0110.00716.55
7.4.110.0120.00616.50
7.4.100.0130.00616.67
7.4.90.0030.01616.54
7.4.80.0140.00419.39
7.4.70.0120.00616.61
7.4.60.0060.01016.67
7.4.50.0040.00016.63
7.4.40.0080.00816.42
7.4.30.0130.00316.41
7.4.10.0090.00915.07
7.4.00.0110.00515.03
7.3.330.0000.00513.38
7.3.320.0060.00013.38
7.3.310.0040.00416.45
7.3.300.0030.00316.26
7.3.290.0070.00716.40
7.3.280.0060.01116.38
7.3.270.0060.01217.40
7.3.260.0000.01816.70
7.3.250.0040.01216.63
7.3.240.0120.00616.31
7.3.230.0100.01316.46
7.3.210.0120.00616.37
7.3.200.0120.00619.39
7.3.190.0100.00716.48
7.3.180.0090.00616.68
7.3.170.0060.01216.56
7.3.160.0130.00716.71
7.3.130.0030.01514.93
7.3.120.0080.01114.91
7.3.110.0020.01514.88
7.3.100.0110.00615.09
7.3.90.0030.01215.02
7.3.80.0080.00814.95
7.3.70.0070.00515.04
7.3.60.0010.01214.74
7.3.50.0040.00914.94
7.3.40.0110.00514.92
7.3.30.0070.00914.79
7.3.20.0030.01016.68
7.3.10.0070.00716.74
7.3.00.0080.00816.62
7.2.330.0070.01016.48
7.2.320.0130.00516.75
7.2.310.0240.01716.79
7.2.300.0000.02016.73
7.2.290.0190.00016.81
7.2.260.0030.01615.32
7.2.250.0060.01215.12
7.2.240.0050.01315.05
7.2.230.0080.00615.20
7.2.220.0080.01015.06
7.2.210.0080.00714.93
7.2.200.0060.00615.18
7.2.190.0060.00914.99
7.2.180.0030.00915.17
7.2.170.0050.01115.13
7.2.160.0150.00614.98
7.2.150.0040.00717.21
7.2.140.0090.00016.91
7.2.130.0030.01316.98
7.2.120.0060.00616.79
7.2.110.0000.01116.99
7.2.100.0040.00716.79
7.2.90.0000.00916.79
7.2.80.0070.00717.02
7.2.70.0080.00416.78
7.2.60.0000.01416.75
7.2.50.0100.00316.83
7.2.40.0040.00816.95
7.2.30.0040.01116.89
7.2.20.0060.00916.97
7.2.10.0000.00916.84
7.2.00.0080.00818.14
7.1.330.0080.00715.95
7.1.320.0090.00715.85
7.1.310.0040.00915.79
7.1.300.0080.00315.84
7.1.290.0070.00815.86
7.1.280.0060.00815.81
7.1.270.0040.00915.81
7.1.260.0050.01115.98
7.1.250.0030.01015.68
7.1.240.0100.00315.71
7.1.230.0040.00415.95
7.1.220.0000.01215.57
7.1.210.0060.00615.88
7.1.200.0070.00715.63
7.1.190.0080.00815.95
7.1.180.0030.01015.95
7.1.170.0000.01415.98
7.1.160.0030.00715.72
7.1.150.0060.00915.92
7.1.140.0040.00415.92
7.1.130.0030.00915.93
7.1.120.0030.00715.54
7.1.110.0090.00615.75
7.1.100.0040.00717.12
7.1.90.0030.01015.73
7.1.80.0000.01216.05
7.1.70.0050.00516.45
7.1.60.0100.00817.49
7.1.50.0090.00516.28
7.1.40.0040.01115.77
7.1.30.0030.00715.75
7.1.20.0100.00315.96
7.1.10.0000.01815.83
7.1.00.0050.04219.21
7.0.330.0060.00615.34
7.0.320.0030.00915.36
7.0.310.0120.00315.50
7.0.300.0060.00615.44
7.0.290.0040.00815.22
7.0.280.0080.00415.63
7.0.270.0000.00915.34
7.0.260.0030.00615.25
7.0.250.0110.00415.32
7.0.240.0030.00715.52
7.0.230.0030.01115.39
7.0.220.0090.00015.40
7.0.210.0030.01215.34
7.0.200.0040.00716.12
7.0.190.0040.00715.29
7.0.180.0040.00815.39
7.0.170.0070.00415.15
7.0.160.0060.00315.47
7.0.150.0040.01115.17
7.0.140.0050.04218.73
7.0.130.0030.01015.38
7.0.120.0070.00715.07
7.0.110.0110.00315.27
7.0.100.0030.01015.30
7.0.90.0070.00315.56
7.0.80.0070.00415.54
7.0.70.0080.00315.63
7.0.60.0050.02417.54
7.0.50.0080.04216.78
7.0.40.0070.02316.79
7.0.30.0130.04816.81
7.0.20.0170.02916.81
7.0.10.0070.02316.87
7.0.00.0100.04216.77
5.6.400.0130.00314.78
5.6.390.0050.00514.37
5.6.380.0060.00914.38
5.6.370.0040.01414.52
5.6.360.0030.00514.47
5.6.350.0030.01014.61
5.6.340.0030.00614.42
5.6.330.0070.00714.41
5.6.320.0040.00414.75
5.6.310.0080.00814.59
5.6.300.0120.00414.32
5.6.290.0060.00614.18
5.6.280.0170.00014.74
5.6.270.0060.00914.46
5.6.260.0070.01014.62
5.6.250.0040.00814.60
5.6.240.0040.00814.57
5.6.230.0060.00614.46
5.6.220.0040.01114.41
5.6.210.0070.03517.50
5.6.200.0080.02416.39
5.6.190.0060.04917.52
5.6.180.1520.02517.40
5.6.170.0170.03717.55
5.6.160.0000.03217.49
5.6.150.0120.02316.24
5.6.140.0030.02816.43
5.6.130.0050.02816.37
5.6.120.0080.03117.76
5.6.110.0150.04217.79
5.6.100.0070.03717.75
5.6.90.0000.02817.58
5.6.80.0090.04017.31
5.6.70.2150.03017.43
5.6.60.0040.00414.47
5.6.50.0070.00714.41
5.6.40.0040.00814.70
5.6.30.0000.01314.55
5.6.20.0120.00314.22
5.6.10.0070.01114.24
5.6.00.0060.00314.38
5.5.380.0000.00814.69
5.5.370.0040.00814.21
5.5.360.0070.00714.57
5.5.350.0140.02817.35
5.5.340.0070.03416.10
5.5.330.0090.02717.29
5.5.320.1480.03017.47
5.5.310.0180.04017.52
5.5.300.0050.03816.31
5.5.290.0050.04616.28
5.5.280.0050.04017.58
5.5.270.0100.03317.65
5.5.260.0020.03117.63
5.5.250.0060.02317.62
5.5.240.0150.02917.42
5.5.230.0030.01014.50
5.5.220.0040.01114.66
5.5.210.0070.01014.44
5.5.200.0060.00614.06
5.5.190.0070.01114.49
5.5.180.0070.00414.41
5.5.170.0060.01214.43
5.5.160.0000.01014.52
5.5.150.0070.00714.09
5.5.140.0060.00314.55
5.5.130.0090.00614.38
5.5.120.0000.01414.32
5.5.110.0080.00614.50
5.5.100.0070.00714.51
5.5.90.0040.00714.37
5.5.80.0060.00914.21
5.5.70.0000.00914.19
5.5.60.0030.00914.25
5.5.50.0000.01114.64
5.5.40.0000.01214.12
5.5.30.0060.00614.52
5.5.20.0070.00714.52
5.5.10.0100.00314.55
5.5.00.0030.01014.26
5.4.450.0580.03316.51
5.4.440.0500.03316.32
5.4.430.0420.02516.45
5.4.420.0420.02816.31
5.4.410.0070.03816.46
5.4.400.0380.03316.38
5.4.390.0070.03416.37
5.4.380.0090.03316.30
5.4.370.0450.02816.41
5.4.360.0330.04416.34
5.4.350.0490.02516.34
5.4.340.0080.02012.74
5.4.330.0000.01113.46
5.4.320.0040.02512.99
5.4.310.0040.02312.98
5.4.300.0040.02212.99
5.4.290.0040.02212.98
5.4.280.0040.02212.94
5.4.270.0060.01812.93
5.4.260.0040.02712.93
5.4.250.0060.02112.94
5.4.240.0020.02512.94
5.4.230.0050.02112.93
5.4.220.0060.02012.93
5.4.210.0060.02112.93
5.4.200.0070.02212.93
5.4.190.0020.02412.93
5.4.180.0060.02112.93
5.4.170.0040.02212.93
5.4.160.0050.02112.93
5.4.150.0060.02312.93
5.4.140.0030.02512.77
5.4.130.0080.02112.76
5.4.120.0060.02212.75
5.4.110.0070.01912.74
5.4.100.0060.01812.74
5.4.90.0040.02212.74
5.4.80.0060.02012.74
5.4.70.0060.01812.74
5.4.60.0050.02012.74
5.4.50.0060.02312.74
5.4.40.0040.02312.73
5.4.30.0050.02112.73
5.4.20.0040.02112.73
5.4.10.0050.02012.73
5.4.00.0050.01912.48
5.3.290.0080.03812.80
5.3.280.0090.04512.71
5.3.270.0070.04812.72
5.3.260.0090.03612.72
5.3.250.0100.03312.71
5.3.240.0040.03812.72
5.3.230.0070.03712.71
5.3.220.0050.03812.68
5.3.210.0030.04312.68
5.3.200.0070.03612.68
5.3.190.0070.03712.68
5.3.180.0060.03612.67
5.3.170.0080.03712.67
5.3.160.0090.03412.68
5.3.150.0100.03512.68
5.3.140.0050.03712.66
5.3.130.0030.04112.66
5.3.120.0070.04212.66
5.3.110.0080.04012.66
5.3.100.0050.03912.13
5.3.90.0050.03712.12
5.3.80.0050.03712.11
5.3.70.0080.03412.11
5.3.60.0040.03812.10
5.3.50.0060.03512.05
5.3.40.0050.03612.05
5.3.30.0080.03312.00
5.3.20.0040.03711.79
5.3.10.0040.03511.75
5.3.00.0040.04611.73
5.2.170.0060.0359.23
5.2.160.0060.0289.23
5.2.150.0070.0289.23
5.2.140.0020.0349.23
5.2.130.0020.0319.20
5.2.120.0050.0289.20
5.2.110.0060.0409.20
5.2.100.0080.0259.20
5.2.90.0060.0339.20
5.2.80.0090.0279.19
5.2.70.0020.0329.20
5.2.60.0050.0299.14
5.2.50.0060.0289.12
5.2.40.0070.0269.09
5.2.30.0090.0259.07
5.2.20.0060.0339.06
5.2.10.0080.0278.96
5.2.00.0060.0358.83
5.1.60.0050.0268.11
5.1.50.0040.0258.11
5.1.40.0060.0268.09
5.1.30.0050.0248.43
5.1.20.0050.0318.45
5.1.10.0050.0248.19
5.1.00.0080.0238.19
5.0.50.0010.0256.67
5.0.40.0020.0206.52
5.0.30.0060.0346.34
5.0.20.0050.0176.33
5.0.10.0040.0196.31
5.0.00.0040.0366.30
4.4.90.0010.0164.78
4.4.80.0020.0204.76
4.4.70.0040.0184.75
4.4.60.0020.0164.76
4.4.50.0030.0144.77
4.4.40.0020.0264.71
4.4.30.0040.0144.76
4.4.20.0040.0204.85
4.4.10.0010.0174.85
4.4.00.0030.0254.76
4.3.110.0030.0154.67
4.3.100.0020.0154.66
4.3.90.0040.0134.63
4.3.80.0050.0224.59
4.3.70.0050.0144.63
4.3.60.0010.0164.63
4.3.50.0040.0194.63
4.3.40.0030.0234.54
4.3.30.0020.0163.30
4.3.20.0010.0163.28
4.3.10.0020.0153.23
4.3.00.0100.0306.78

preferences:
53.12 ms | 401 KiB | 5 Q