3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "MULTILINESTRING ((-77.083060324719384 42.15108721847372, -77.087448024528669 42.151768518696542"; $pattern = '/((-?\d+\.\d+)\s(-?\d+\.\d+))/'; $arr = preg_match_all($pattern,$string,$matches); print_r($matches); $len = count($matches[0]); $coordinates = []; for($i=0;$i<$len;++$i){ $coordinates[] = [ $matches[2][$i], $matches[3][$i] ]; } print_r($coordinates);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
2 jumps found. (Code = 44) Position 1 = 28, Position 2 = 17
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
2 jumps found. (Code = 44) Position 1 = 28, Position 2 = 17
Branch analysis from position: 28
Branch analysis from position: 17
filename:       /in/ecLFJ
function name:  (null)
number of ops:  32
compiled vars:  !0 = $string, !1 = $pattern, !2 = $arr, !3 = $matches, !4 = $len, !5 = $coordinates, !6 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'MULTILINESTRING+%28%28-77.083060324719384+42.15108721847372%2C+-77.087448024528669+42.151768518696542'
    4     1        ASSIGN                                                   !1, '%2F%28%28-%3F%5Cd%2B%5C.%5Cd%2B%29%5Cs%28-%3F%5Cd%2B%5C.%5Cd%2B%29%29%2F'
    6     2        INIT_FCALL                                               'preg_match_all'
          3        SEND_VAR                                                 !1
          4        SEND_VAR                                                 !0
          5        SEND_REF                                                 !3
          6        DO_ICALL                                         $9      
          7        ASSIGN                                                   !2, $9
    8     8        INIT_FCALL                                               'print_r'
          9        SEND_VAR                                                 !3
         10        DO_ICALL                                                 
   10    11        FETCH_DIM_R                                      ~12     !3, 0
         12        COUNT                                            ~13     ~12
         13        ASSIGN                                                   !4, ~13
   11    14        ASSIGN                                                   !5, <array>
   12    15        ASSIGN                                                   !6, 0
         16      > JMP                                                      ->26
   14    17    >   FETCH_DIM_R                                      ~18     !3, 2
         18        FETCH_DIM_R                                      ~19     ~18, !6
         19        INIT_ARRAY                                       ~20     ~19
         20        FETCH_DIM_R                                      ~21     !3, 3
         21        FETCH_DIM_R                                      ~22     ~21, !6
         22        ADD_ARRAY_ELEMENT                                ~20     ~22
   13    23        ASSIGN_DIM                                               !5
   14    24        OP_DATA                                                  ~20
   12    25        PRE_INC                                                  !6
         26    >   IS_SMALLER                                               !6, !4
         27      > JMPNZ                                                    ~24, ->17
   19    28    >   INIT_FCALL                                               'print_r'
         29        SEND_VAR                                                 !5
         30        DO_ICALL                                                 
         31      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
288.08 ms | 1012 KiB | 15 Q