3v4l.org

run code in 300+ PHP versions simultaneously
<?php $lat1=32.434355; $lng1=45.2894835; $lat2=32.434355; $lng2=45.2894835; $R = 6371000; $dLat = deg2rad($lat2-$lat1); $dLon = deg2rad($lng2-$lng1); $a = sin($dLat/2) *sin($dLat/2) + cos(deg2rad($lat1)) *cos(deg2rad($lat2)) *sin($dLon/2) *sin($dLon/2); $c = 2 * atan2(sqrt($a), sqrt(1-$a)); $d = $R * $c; echo $d; return $d; ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dcMbi
function name:  (null)
number of ops:  67
compiled vars:  !0 = $lat1, !1 = $lng1, !2 = $lat2, !3 = $lng2, !4 = $R, !5 = $dLat, !6 = $dLon, !7 = $a, !8 = $c, !9 = $d
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 32.4344
    4     1        ASSIGN                                                   !1, 45.2895
    5     2        ASSIGN                                                   !2, 32.4344
    6     3        ASSIGN                                                   !3, 45.2895
    7     4        ASSIGN                                                   !4, 6371000
    8     5        INIT_FCALL                                               'deg2rad'
          6        SUB                                              ~15     !2, !0
          7        SEND_VAL                                                 ~15
          8        DO_ICALL                                         $16     
          9        ASSIGN                                                   !5, $16
    9    10        INIT_FCALL                                               'deg2rad'
         11        SUB                                              ~18     !3, !1
         12        SEND_VAL                                                 ~18
         13        DO_ICALL                                         $19     
         14        ASSIGN                                                   !6, $19
   10    15        INIT_FCALL                                               'sin'
         16        DIV                                              ~21     !5, 2
         17        SEND_VAL                                                 ~21
         18        DO_ICALL                                         $22     
         19        INIT_FCALL                                               'sin'
         20        DIV                                              ~23     !5, 2
         21        SEND_VAL                                                 ~23
         22        DO_ICALL                                         $24     
         23        MUL                                              ~25     $22, $24
         24        INIT_FCALL                                               'cos'
         25        INIT_FCALL                                               'deg2rad'
         26        SEND_VAR                                                 !0
         27        DO_ICALL                                         $26     
         28        SEND_VAR                                                 $26
         29        DO_ICALL                                         $27     
         30        INIT_FCALL                                               'cos'
         31        INIT_FCALL                                               'deg2rad'
         32        SEND_VAR                                                 !2
         33        DO_ICALL                                         $28     
         34        SEND_VAR                                                 $28
         35        DO_ICALL                                         $29     
         36        MUL                                              ~30     $27, $29
         37        INIT_FCALL                                               'sin'
         38        DIV                                              ~31     !6, 2
         39        SEND_VAL                                                 ~31
         40        DO_ICALL                                         $32     
         41        MUL                                              ~33     $32, ~30
         42        INIT_FCALL                                               'sin'
         43        DIV                                              ~34     !6, 2
         44        SEND_VAL                                                 ~34
         45        DO_ICALL                                         $35     
         46        MUL                                              ~36     $35, ~33
         47        ADD                                              ~37     ~25, ~36
         48        ASSIGN                                                   !7, ~37
   11    49        INIT_FCALL                                               'atan2'
         50        INIT_FCALL                                               'sqrt'
         51        SEND_VAR                                                 !7
         52        DO_ICALL                                         $39     
         53        SEND_VAR                                                 $39
         54        INIT_FCALL                                               'sqrt'
         55        SUB                                              ~40     1, !7
         56        SEND_VAL                                                 ~40
         57        DO_ICALL                                         $41     
         58        SEND_VAR                                                 $41
         59        DO_ICALL                                         $42     
         60        MUL                                              ~43     $42, 2
         61        ASSIGN                                                   !8, ~43
   12    62        MUL                                              ~45     !4, !8
         63        ASSIGN                                                   !9, ~45
   13    64        ECHO                                                     !9
   14    65      > RETURN                                                   !9
   17    66*     > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
179.88 ms | 1400 KiB | 23 Q