3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string='Nearest Location: 771 km S 43° E of Quezon City 051 km S 66° E of Surigao City 007 km S 51° W of Socorro (Surigao Del Norte) 049 km N 70° E of PFZ EAST MINDANAO SEGMENT'; if(preg_match_all('/^(.*? of) \K.+/m',$string,$out)){ list($location,$distance_bearing)=$out; } var_export($distance_bearing); echo "\n\n"; var_export($location);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 13
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
filename:       /in/RVh0Q
function name:  (null)
number of ops:  21
compiled vars:  !0 = $string, !1 = $out, !2 = $location, !3 = $distance_bearing
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'Nearest+Location%3A%0A771+km+S+43%C2%B0+E+of+Quezon+City%0A051+km+S+66%C2%B0+E+of+Surigao+City%0A007+km+S+51%C2%B0+W+of+Socorro+%28Surigao+Del+Norte%29%0A049+km+N+70%C2%B0+E+of+PFZ+EAST+MINDANAO+SEGMENT'
    8     1        INIT_FCALL                                               'preg_match_all'
          2        SEND_VAL                                                 '%2F%5E%28.%2A%3F+of%29+%5CK.%2B%2Fm'
          3        SEND_VAR                                                 !0
          4        SEND_REF                                                 !1
          5        DO_ICALL                                         $5      
          6      > JMPZ                                                     $5, ->13
    9     7    >   QM_ASSIGN                                        ~6      !1
          8        FETCH_LIST_R                                     $7      ~6, 0
          9        ASSIGN                                                   !2, $7
         10        FETCH_LIST_R                                     $9      ~6, 1
         11        ASSIGN                                                   !3, $9
         12        FREE                                                     ~6
   11    13    >   INIT_FCALL                                               'var_export'
         14        SEND_VAR                                                 !3
         15        DO_ICALL                                                 
   12    16        ECHO                                                     '%0A%0A'
   13    17        INIT_FCALL                                               'var_export'
         18        SEND_VAR                                                 !2
         19        DO_ICALL                                                 
         20      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.22 ms | 1011 KiB | 15 Q