3v4l.org

run code in 300+ PHP versions simultaneously
<?php function UTMtoGeog($Easting,$Northing,$UtmZone,$SouthofEquator=false) //Convert UTM Coordinates to Geographic { //Declarations //Symbols as used in USGS PP 1395: Map Projections - A Working Manual $k0 = 0.9996;//scale on central meridian $a = 6378137.0;//equatorial radius, meters. $f = 1/298.2572236;//polar flattening. $b = $a*(1-$f);//polar axis. $e = sqrt(1 - $b*$b/$a*$a);//eccentricity $drad = pi()/180;//Convert degrees to radians) $phi = 0;//latitude (north +, south -), but uses phi in reference $e0 = $e/sqrt(1 - $e*$e);//e prime in reference $lng = 0;//Longitude (e = +, w = -) $lng0 = 0;//longitude of central meridian $lngd = 0;//longitude in degrees $M = 0;//M requires calculation $x = 0;//x coordinate $y = 0;//y coordinate $k = 1;//local scale $zcm = 0;//zone central meridian //End declarations //Convert UTM Coordinates to Geographic $k0 = 0.9996;//scale on central meridian $b = $a*(1-$f);//polar axis. $e = sqrt(1 - ($b/$a)*($b/$a));//eccentricity $e0 = $e/sqrt(1 - $e*$e);//Called e prime in reference $esq =(1 - ($b/$a)*($b/$a));//e squared for use in expansions $e0sq =$e*$e/(1-$e*$e);// e0 squared - always even powers $x = $Easting; if ($x<160000 || $x>840000) echo "Outside permissible range of easting values \n Results may be unreliable \n Use with caution\n"; $y = $Northing; if ($y<0) echo "Negative values not allowed \n Results may be unreliable \n Use with caution\n"; if ($y>10000000) echo "Northing may not exceed 10,000,000 \n Results may be unreliable \n Use with caution\n"; $zcm =3 + 6*($UtmZone-1) - 180;//Central meridian of zone $e1 =(1 - sqrt(1 - $e*$e))/(1 + sqrt(1 - $e*$e));//Called e1 in USGS PP 1395 also $M0 =0;//In case origin other than zero lat - not needed for standard UTM $M =$M0 + $y/$k0;//Arc length along standard meridian. if ($SouthofEquator === true) $M=$M0+($y-10000000)/$k; $mu =$M/($a*(1 - $esq*(1/4 + $esq*(3/64 + 5*$esq/256)))); $phi1 =$mu + $e1*(3/2 - 27*$e1*$e1/32)*sin(2*$mu) + $e1*$e1*(21/16 -55*$e1*$e1/32)*sin(4*$mu);//Footprint Latitude $phi1 =$phi1 + $e1*$e1*$e1*(sin(6*$mu)*151/96 + $e1*sin(8*$mu)*1097/512); $C1 =$e0sq*pow(cos($phi1),2); $T1 =pow(tan($phi1),2); $N1 =$a/sqrt(1-pow($e*sin($phi1),2)); $R1 =$N1*(1-$e*$e)/(1-pow($e*sin($phi1),2)); $D =($x-500000)/($N1*$k0); $phi =($D*$D)*(1/2 - $D*$D*(5 + 3*$T1 + 10*$C1 - 4*$C1*$C1 - 9*$e0sq)/24); $phi =$phi + pow($D,6)*(61 + 90*$T1 + 298*$C1 + 45*$T1*$T1 -252*$e0sq - 3*$C1*$C1)/720; $phi =$phi1 - ($N1*tan($phi1)/$R1)*$phi; //Longitude $lng =$D*(1 + $D*$D*((-1 -2*$T1 -$C1)/6 + $D*$D*(5 - 2*$C1 + 28*$T1 - 3*$C1*$C1 +8*$e0sq + 24*$T1*$T1)/120))/cos($phi1); $lngd = $zcm+$lng/$drad; return array(floor(1000000*$phi/$drad)/1000000,floor(1000000*$lngd)/1000000); //Latitude,Longitude } $r = array(); for ($a = 0; $a < 1; $a = $a + 0.00001) { $utm = UTMtoGeog(377298.745+$a, 1483034.794+$a, 48); $r[] = $utm; }

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.5.10.0320.14843.21
8.5.00.0290.15643.35
8.4.150.0020.00114.05
8.4.140.0310.17140.93
8.4.130.0290.12440.91
8.4.120.0220.12547.36
8.4.110.0280.10344.71
8.4.100.0150.10142.34
8.4.90.0180.10942.06
8.4.80.0150.09642.28
8.4.70.0260.12741.49
8.4.60.0310.13741.90
8.4.50.0290.15041.84
8.4.40.0130.12843.29
8.4.30.0330.13240.77
8.4.20.0230.15340.95
8.4.10.0230.11841.02
8.3.280.0290.16241.57
8.3.270.0200.18339.66
8.3.260.0190.10840.38
8.3.250.0230.11341.95
8.3.240.0180.09740.54
8.3.230.0240.10839.85
8.3.220.0310.10642.22
8.3.210.0190.14839.93
8.3.200.0200.12639.94
8.3.190.0250.13840.60
8.3.180.0320.13040.37
8.3.170.0300.13942.23
8.3.160.0270.14240.55
8.3.150.0170.12340.43
8.3.140.0330.14640.14
8.3.130.0260.14240.16
8.3.120.0430.14042.38
8.3.110.0200.12041.86
8.3.100.0030.12640.75
8.3.90.0330.15040.11
8.3.80.0070.14540.77
8.3.70.0360.21939.98
8.3.60.0170.21841.16
8.3.50.0200.23941.20
8.3.40.0170.23241.96
8.3.30.0330.24441.97
8.3.20.0200.17143.84
8.3.10.0200.15745.34
8.3.00.0200.13942.59
8.2.290.0230.09943.98
8.2.280.0250.14141.21
8.2.270.0330.13740.77
8.2.260.0270.12639.78
8.2.250.0230.14539.99
8.2.240.0070.14541.42
8.2.230.0270.11039.75
8.2.220.0200.11639.95
8.2.210.0340.14140.16
8.2.200.0300.14240.04
8.2.190.0470.24639.54
8.2.180.0360.21639.88
8.2.170.0400.23242.04
8.2.160.0300.24143.08
8.2.150.0230.16442.28
8.2.140.0200.12544.05
8.2.130.0270.14943.72
8.2.120.0270.11343.89
8.2.110.0300.13843.60
8.2.100.0360.15141.28
8.2.90.0130.16642.48
8.2.80.0130.16640.75
8.2.70.0140.16640.97
8.2.60.0200.14342.50
8.2.50.0200.16441.00
8.2.40.0130.14843.67
8.2.30.0100.17542.79
8.2.20.0100.16241.21
8.2.10.0030.17541.35
8.2.00.0130.16341.45
8.1.330.0300.11961.29
8.1.320.0400.13456.22
8.1.310.0340.12256.34
8.1.300.0170.13455.72
8.1.290.0300.15756.07
8.1.280.0270.21657.21
8.1.270.0300.09948.67
8.1.260.0230.11048.63
8.1.250.0170.08348.96
8.1.240.0100.09848.76
8.1.230.0290.10547.32
8.1.220.0200.10344.16
8.1.210.0130.10843.86
8.1.200.0070.11943.48
8.1.190.0200.10443.63
8.1.180.0100.11643.60
8.1.170.0030.11644.84
8.1.160.0140.10045.31
8.1.150.0170.10645.21
8.1.140.0130.11045.80
8.1.130.0100.11243.91
8.1.120.0100.13843.79
8.1.110.0070.11643.73
8.1.100.0070.11943.88
8.1.90.0030.11643.84
8.1.80.0330.08443.75
8.1.70.0130.10543.64
8.1.60.0270.10043.92
8.1.50.0230.10243.79
8.1.40.0170.10643.87
8.1.30.0200.11243.73
8.1.20.0130.11043.87
8.1.10.0100.17757.27
8.1.00.0240.16457.30
8.0.300.0230.14956.46
8.0.290.0130.18356.37
8.0.280.0160.16457.92
8.0.270.0450.19656.89
8.0.260.0270.15858.04
8.0.250.0240.15556.46
8.0.240.0170.16756.65
8.0.230.0100.17756.47
8.0.220.0100.17556.50
8.0.210.0170.20356.38
8.0.200.0100.17456.50
8.0.190.0260.15856.66
8.0.180.0460.19956.48
8.0.170.0100.17556.63
8.0.160.0200.16156.49
8.0.150.0200.16256.48
8.0.140.0240.16856.53
8.0.130.0230.26952.97
8.0.120.0130.18556.39
8.0.110.0230.16056.45
8.0.100.0170.17056.46
8.0.90.0130.17556.54
8.0.80.0500.39556.34
8.0.70.0130.20156.45
8.0.60.0300.16656.29
8.0.50.0200.17456.47
8.0.30.0510.19756.49
8.0.20.0440.39956.38
8.0.10.0200.17356.59
8.0.00.0500.46056.26
7.4.330.0100.16253.25
7.4.320.0170.15956.14
7.4.300.0170.15556.04
7.4.290.0270.15056.12
7.4.280.0140.16656.03
7.4.270.0200.16156.04
7.4.260.0230.21556.11
7.4.250.0200.15956.19
7.4.240.0270.15755.91
7.4.230.0170.16056.27
7.4.220.0990.63956.02
7.4.210.0410.42756.01
7.4.200.0200.16056.23
7.4.160.0530.35855.94
7.4.150.0360.49856.04
7.4.140.0560.40355.94
7.4.130.0530.38556.05
7.4.120.0620.42756.02
7.4.110.0590.50255.95
7.4.100.0600.46856.11
7.4.90.0520.43255.98
7.4.80.0720.55355.79
7.4.70.0330.44856.05
7.4.60.0650.57556.13
7.4.50.0200.39456.02
7.4.40.0530.44856.03
7.4.30.0460.39455.99
7.3.330.0270.20452.86
7.3.320.0270.16352.84
7.3.310.0070.18455.89
7.3.300.0170.18055.89
7.3.290.0170.18356.05
7.3.280.0530.44455.83
7.3.270.0500.40255.85
7.3.260.0500.41755.82
7.3.250.0420.45755.83
7.3.240.0610.45255.86
7.3.230.0620.40756.04
7.3.210.0430.44355.95
7.3.200.0630.41455.79
7.3.190.0780.54156.00
7.3.180.0670.57355.90
7.3.170.0460.43455.74
7.3.160.0730.44655.87
7.2.330.0500.41656.05
7.2.320.0540.56856.25
7.2.310.0390.42756.26
7.2.300.0360.42056.34
7.2.290.0430.43756.20
7.1.00.0100.49763.22
5.6.280.0270.99078.55

preferences:
35.92 ms | 403 KiB | 5 Q