3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array['route'] = 'LINESTRING(-25.3233034167988 -57.640113830566406,-25.3229348965009 -57.64023184776306,-25.322653656571582 -57.63954520225525,-25.323410093517822 -57.63928771018982,-25.3229058027454 -57.6378607749939,-25.322973688164012 -57.63678789138794,-25.323371301994506 -57.63360142707825,-25.322003892857673 -57.633676528930664,-25.31995759927745 -57.633376121520996,-25.319336915717006 -57.63331174850464,-25.317988857651912 -57.63302206993103,-25.317377862364236 -57.63294696807861,-25.317688209562228 -57.62954592704773)'; $str = $array['route']; // Get the string from the array $str = substr( $str, 11); // Get rid of "LINESTRING(" $str = substr( $str, 0, strlen( $str) -1); // Get rid of trailing ")" $objective = str_getcsv( $str); // Form the objective array. foreach( $objective as $k => $v) { list( $x, $y) = explode( ' ', $v); $objective[$k] = array(); $objective[$k]['x'] = $x; $objective[$k]['y'] = $y; } print_r( $objective);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 22, Position 2 = 42
Branch analysis from position: 22
2 jumps found. (Code = 78) Position 1 = 23, Position 2 = 42
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
Branch analysis from position: 42
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 42
filename:       /in/9dKsf
function name:  (null)
number of ops:  47
compiled vars:  !0 = $array, !1 = $str, !2 = $objective, !3 = $v, !4 = $k, !5 = $x, !6 = $y
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN_DIM                                               !0, 'route'
          1        OP_DATA                                                  'LINESTRING%28-25.3233034167988+-57.640113830566406%2C-25.3229348965009+-57.64023184776306%2C-25.322653656571582+-57.63954520225525%2C-25.323410093517822+-57.63928771018982%2C-25.3229058027454+-57.6378607749939%2C-25.322973688164012+-57.63678789138794%2C-25.323371301994506+-57.63360142707825%2C-25.322003892857673+-57.633676528930664%2C-25.31995759927745+-57.633376121520996%2C-25.319336915717006+-57.63331174850464%2C-25.317988857651912+-57.63302206993103%2C-25.317377862364236+-57.63294696807861%2C-25.317688209562228+-57.62954592704773%29'
    5     2        FETCH_DIM_R                                      ~8      !0, 'route'
          3        ASSIGN                                                   !1, ~8
    6     4        INIT_FCALL                                               'substr'
          5        SEND_VAR                                                 !1
          6        SEND_VAL                                                 11
          7        DO_ICALL                                         $10     
          8        ASSIGN                                                   !1, $10
    7     9        INIT_FCALL                                               'substr'
         10        SEND_VAR                                                 !1
         11        SEND_VAL                                                 0
         12        STRLEN                                           ~12     !1
         13        SUB                                              ~13     ~12, 1
         14        SEND_VAL                                                 ~13
         15        DO_ICALL                                         $14     
         16        ASSIGN                                                   !1, $14
    8    17        INIT_FCALL                                               'str_getcsv'
         18        SEND_VAR                                                 !1
         19        DO_ICALL                                         $16     
         20        ASSIGN                                                   !2, $16
   10    21      > FE_RESET_R                                       $18     !2, ->42
         22    > > FE_FETCH_R                                       ~19     $18, !3, ->42
         23    >   ASSIGN                                                   !4, ~19
   11    24        INIT_FCALL                                               'explode'
         25        SEND_VAL                                                 '+'
         26        SEND_VAR                                                 !3
         27        DO_ICALL                                         $21     
         28        FETCH_LIST_R                                     $22     $21, 0
         29        ASSIGN                                                   !5, $22
         30        FETCH_LIST_R                                     $24     $21, 1
         31        ASSIGN                                                   !6, $24
         32        FREE                                                     $21
   12    33        ASSIGN_DIM                                               !2, !4
         34        OP_DATA                                                  <array>
   13    35        FETCH_DIM_W                                      $27     !2, !4
         36        ASSIGN_DIM                                               $27, 'x'
         37        OP_DATA                                                  !5
   14    38        FETCH_DIM_W                                      $29     !2, !4
         39        ASSIGN_DIM                                               $29, 'y'
         40        OP_DATA                                                  !6
   10    41      > JMP                                                      ->22
         42    >   FE_FREE                                                  $18
   17    43        INIT_FCALL                                               'print_r'
         44        SEND_VAR                                                 !2
         45        DO_ICALL                                                 
         46      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.16 ms | 1404 KiB | 21 Q