3v4l.org

run code in 300+ PHP versions simultaneously
<?php $name= 'TEST'; $circleLat = 19.282494; $circleLon = 166.636650; $circleRadius = 1047*1852; $circlePrecision =5; $coordinatesList = ""; // Code based on Google Earth community posting by 'ink_polaroid' // http://bbs.keyhole.com/ubb/showflat.php/Cat/0/Number/23634/an//page//vc/1 $num_points = 36; $delta_pts = 360/$num_points; // convert coordinates to radians $lat = deg2rad(floatval($circleLat)); $lon = deg2rad(floatval($circleLon)); $d = $circleRadius; $d_rad = $d/6378137; // convert dist to angular distance in radians // loop around the compass, appending coordinates of each vertex for($i=0; $i<=$num_points; $i++) { $radial = deg2rad($i*$delta_pts); $lonCircle = $d_rad*sin($radial); $latCircle = $d_rad*cos($radial); $coordinatesList .= Round(rad2deg($lon+$lonCircle),$circlePrecision).",". Round(rad2deg($lat+$latCircle),$circlePrecision).",30\n"; } print_r($coordinatesList);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 60
Branch analysis from position: 60
2 jumps found. (Code = 44) Position 1 = 62, Position 2 = 24
Branch analysis from position: 62
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
2 jumps found. (Code = 44) Position 1 = 62, Position 2 = 24
Branch analysis from position: 62
Branch analysis from position: 24
filename:       /in/YfbuD
function name:  (null)
number of ops:  66
compiled vars:  !0 = $name, !1 = $circleLat, !2 = $circleLon, !3 = $circleRadius, !4 = $circlePrecision, !5 = $coordinatesList, !6 = $num_points, !7 = $delta_pts, !8 = $lat, !9 = $lon, !10 = $d, !11 = $d_rad, !12 = $i, !13 = $radial, !14 = $lonCircle, !15 = $latCircle
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'TEST'
    4     1        ASSIGN                                                   !1, 19.2825
    5     2        ASSIGN                                                   !2, 166.637
    6     3        ASSIGN                                                   !3, 1939044
    7     4        ASSIGN                                                   !4, 5
    8     5        ASSIGN                                                   !5, ''
   11     6        ASSIGN                                                   !6, 36
   12     7        DIV                                              ~23     360, !6
          8        ASSIGN                                                   !7, ~23
   14     9        INIT_FCALL                                               'deg2rad'
         10        CAST                                          5  ~25     !1
         11        SEND_VAL                                                 ~25
         12        DO_ICALL                                         $26     
         13        ASSIGN                                                   !8, $26
   15    14        INIT_FCALL                                               'deg2rad'
         15        CAST                                          5  ~28     !2
         16        SEND_VAL                                                 ~28
         17        DO_ICALL                                         $29     
         18        ASSIGN                                                   !9, $29
   16    19        ASSIGN                                                   !10, !3
   17    20        DIV                                              ~32     !10, 6378137
         21        ASSIGN                                                   !11, ~32
   19    22        ASSIGN                                                   !12, 0
         23      > JMP                                                      ->60
   20    24    >   INIT_FCALL                                               'deg2rad'
         25        MUL                                              ~35     !12, !7
         26        SEND_VAL                                                 ~35
         27        DO_ICALL                                         $36     
         28        ASSIGN                                                   !13, $36
   21    29        INIT_FCALL                                               'sin'
         30        SEND_VAR                                                 !13
         31        DO_ICALL                                         $38     
         32        MUL                                              ~39     !11, $38
         33        ASSIGN                                                   !14, ~39
   22    34        INIT_FCALL                                               'cos'
         35        SEND_VAR                                                 !13
         36        DO_ICALL                                         $41     
         37        MUL                                              ~42     !11, $41
         38        ASSIGN                                                   !15, ~42
   23    39        INIT_FCALL                                               'round'
         40        INIT_FCALL                                               'rad2deg'
         41        ADD                                              ~44     !9, !14
         42        SEND_VAL                                                 ~44
         43        DO_ICALL                                         $45     
         44        SEND_VAR                                                 $45
         45        SEND_VAR                                                 !4
         46        DO_ICALL                                         $46     
         47        CONCAT                                           ~47     $46, '%2C'
   24    48        INIT_FCALL                                               'round'
         49        INIT_FCALL                                               'rad2deg'
         50        ADD                                              ~48     !8, !15
         51        SEND_VAL                                                 ~48
         52        DO_ICALL                                         $49     
         53        SEND_VAR                                                 $49
         54        SEND_VAR                                                 !4
         55        DO_ICALL                                         $50     
         56        CONCAT                                           ~51     ~47, $50
         57        CONCAT                                           ~52     ~51, '%2C30%0A'
         58        ASSIGN_OP                                     8          !5, ~52
   19    59        PRE_INC                                                  !12
         60    >   IS_SMALLER_OR_EQUAL                                      !12, !6
         61      > JMPNZ                                                    ~55, ->24
   26    62    >   INIT_FCALL                                               'print_r'
         63        SEND_VAR                                                 !5
         64        DO_ICALL                                                 
         65      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
139.2 ms | 1008 KiB | 19 Q