3v4l.org

run code in 300+ PHP versions simultaneously
<?php $Fecha = "2016-01-27 11:50:19"; function CalcularTiempo($Timestamp){ $Segundos = strtotime('now') - strtotime($Timestamp); return intval($Segundos); } function CalcularVelocidad($Distancia, $Tiempo){ $salida = $Distancia / $Tiempo; return $salida / 1000; } function CalcularDistancia($OrigenLat, $OrigenLon, $DestinoLat, $DestinoLon){ $R = 6371; $dLat = ($DestinoLat - $OrigenLat) * (pi() / 180); $dLon = ($DestinoLon - $OrigenLon) * (pi() / 180); $a = sin($dLat / 2) * sin($dLat / 2) + cos($OrigenLat * (pi() / 180)) * cos($DestinoLat * (pi() / 180)) * sin($dLon / 2) * sin($dLon / 2); $c = 2 * atan2(sqrt($a), sqrt(1 - $a)); return ($R * $c) * 1000; } $Tiempo = CalcularTiempo($Fecha); $Distancia = CalcularDistancia(38.278096798610605,-0.6911851008339024,38.2788421664234,-0.6901980479164007); $Velocidad = CalcularVelocidad($Distancia, $Tiempo); echo $Velocidad; echo '\n'; echo float(7.6734156326455E-5); ?>
Output for 7.0.20, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.31, 7.4.0 - 7.4.33, 8.0.0 - 8.0.12, 8.0.14 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6
6.9995208171322E-5\n Fatal error: Uncaught Error: Call to undefined function float() in /in/nnSUh:32 Stack trace: #0 {main} thrown in /in/nnSUh on line 32
Process exited with code 255.
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 6.9995208171322E-5\n Fatal error: Uncaught Error: Call to undefined function float() in /in/nnSUh:32 Stack trace: #0 {main} thrown in /in/nnSUh on line 32
Process exited with code 255.
Output for 7.3.32 - 7.3.33, 8.0.13
-6.3188063190601E-5\n Fatal error: Uncaught Error: Call to undefined function float() in /in/nnSUh:32 Stack trace: #0 {main} thrown in /in/nnSUh on line 32
Process exited with code 255.
Output for 7.0.6
1.2025280523417E-8\n Fatal error: Uncaught Error: Call to undefined function float() in /in/nnSUh:32 Stack trace: #0 {main} thrown in /in/nnSUh on line 32
Process exited with code 255.
Output for 7.0.5
2.0685090084166E-8\n Fatal error: Uncaught Error: Call to undefined function float() in /in/nnSUh:32 Stack trace: #0 {main} thrown in /in/nnSUh on line 32
Process exited with code 255.
Output for 7.0.4
3.185197026465E-8\n Fatal error: Uncaught Error: Call to undefined function float() in /in/nnSUh:32 Stack trace: #0 {main} thrown in /in/nnSUh on line 32
Process exited with code 255.
Output for 7.0.3
2.6863421419139E-8\n Fatal error: Uncaught Error: Call to undefined function float() in /in/nnSUh:32 Stack trace: #0 {main} thrown in /in/nnSUh on line 32
Process exited with code 255.
Output for 7.0.2
2.4813814236628E-8\n Fatal error: Uncaught Error: Call to undefined function float() in /in/nnSUh:32 Stack trace: #0 {main} thrown in /in/nnSUh on line 32
Process exited with code 255.
Output for 7.0.1
2.4322641615767E-8\n Fatal error: Uncaught Error: Call to undefined function float() in /in/nnSUh:32 Stack trace: #0 {main} thrown in /in/nnSUh on line 32
Process exited with code 255.
Output for 7.0.0
2.3090431137793E-8\n Fatal error: Uncaught Error: Call to undefined function float() in /in/nnSUh:32 Stack trace: #0 {main} thrown in /in/nnSUh on line 32
Process exited with code 255.
Output for 5.6.28
6.9995208171322E-5\n Fatal error: Call to undefined function float() in /in/nnSUh on line 32
Process exited with code 255.
Output for 5.6.21
1.4386271548589E-8\n Fatal error: Call to undefined function float() in /in/nnSUh on line 32
Process exited with code 255.
Output for 5.6.20
1.8735759833087E-8\n Fatal error: Call to undefined function float() in /in/nnSUh on line 32
Process exited with code 255.
Output for 5.6.19
3.3929615792774E-8\n Fatal error: Call to undefined function float() in /in/nnSUh on line 32
Process exited with code 255.
Output for 5.6.18
2.8733167872364E-8\n Fatal error: Call to undefined function float() in /in/nnSUh on line 32
Process exited with code 255.
Output for 5.6.17
2.6285181990871E-8\n Fatal error: Call to undefined function float() in /in/nnSUh on line 32
Process exited with code 255.
Output for 5.6.16
2.2698693246604E-8\n Fatal error: Call to undefined function float() in /in/nnSUh on line 32
Process exited with code 255.
Output for 5.6.15
2.2319879729622E-8\n Fatal error: Call to undefined function float() in /in/nnSUh on line 32
Process exited with code 255.
Output for 5.6.14
1.7687102896042E-8\n Fatal error: Call to undefined function float() in /in/nnSUh on line 32
Process exited with code 255.
Output for 5.6.13
1.7457475965724E-8\n Fatal error: Call to undefined function float() in /in/nnSUh on line 32
Process exited with code 255.
Output for 5.6.12
1.64992225343E-8\n Fatal error: Call to undefined function float() in /in/nnSUh on line 32
Process exited with code 255.
Output for 5.6.11
1.5700246020185E-8\n Fatal error: Call to undefined function float() in /in/nnSUh on line 32
Process exited with code 255.
Output for 5.6.10
1.5508918375631E-8\n Fatal error: Call to undefined function float() in /in/nnSUh on line 32
Process exited with code 255.
Output for 5.6.9
1.5131030526706E-8\n Fatal error: Call to undefined function float() in /in/nnSUh on line 32
Process exited with code 255.
Output for 5.6.8
1.4751739649337E-8\n Fatal error: Call to undefined function float() in /in/nnSUh on line 32
Process exited with code 255.
Output for 5.5.35
1.1866054434201E-8\n Fatal error: Call to undefined function float() in /in/nnSUh on line 32
Process exited with code 255.
Output for 5.5.34
1.8462443213077E-8\n Fatal error: Call to undefined function float() in /in/nnSUh on line 32
Process exited with code 255.
Output for 5.5.33
3.301578701112E-8\n Fatal error: Call to undefined function float() in /in/nnSUh on line 32
Process exited with code 255.
Output for 5.5.32
2.7495824069099E-8\n Fatal error: Call to undefined function float() in /in/nnSUh on line 32
Process exited with code 255.
Output for 5.5.31
2.5731787703947E-8\n Fatal error: Call to undefined function float() in /in/nnSUh on line 32
Process exited with code 255.
Output for 5.5.30
2.126447546407E-8\n Fatal error: Call to undefined function float() in /in/nnSUh on line 32
Process exited with code 255.
Output for 5.5.29
1.7113434157669E-8\n Fatal error: Call to undefined function float() in /in/nnSUh on line 32
Process exited with code 255.
Output for 5.5.28
1.6278141566433E-8\n Fatal error: Call to undefined function float() in /in/nnSUh on line 32
Process exited with code 255.
Output for 5.5.27
1.6076461144788E-8\n Fatal error: Call to undefined function float() in /in/nnSUh on line 32
Process exited with code 255.
Output for 5.5.26
1.531789636862E-8\n Fatal error: Call to undefined function float() in /in/nnSUh on line 32
Process exited with code 255.
Output for 5.5.25
1.4935782800738E-8\n Fatal error: Call to undefined function float() in /in/nnSUh on line 32
Process exited with code 255.
Output for 5.5.24
1.1734800822731E-8\n Fatal error: Call to undefined function float() in /in/nnSUh on line 32
Process exited with code 255.

preferences:
202.4 ms | 401 KiB | 228 Q