3v4l.org

run code in 300+ PHP versions simultaneously
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> </head> <body> <form method="post"> <textarea name="data" style="width: 100%; height: 300px"></textarea> <input type="submit"> </form> <?php $data = isset($_POST['data']) ? $_POST['data'] : ""; if ($data) { function parse($text) { global $foundName; global $foundCoord; $foundName = array(); $foundCoord = array(); preg_replace_callback('#\<Placemark (.+?)\<\/name\>#msi', function($matches) { global $foundName; $ex = explode(">", $matches[1]); $foundName[] = end($ex); } , $text); preg_replace_callback('#\<coordinates\>(.+?)\<\/coordinates\>#msi', function($matches) { global $foundCoord; $foundCoord[] = $matches[1]; } , $text); return array("name" => $foundName, "coord" => $foundCoord);; } $d = parse($data); $res = ""; $counter = 0; foreach($d['name'] as $k => $v) { $name = $v; $point = explode(",", (string) $d['coord'][$k]); $out = "GMSMarker*marker" . $counter ++ . "= [[GMSMarker alloc] init]; \n"; $out .= "marker" . $counter . ".position = CLLocationCoordinate2DMake(" . $point[1] . "," . $point[0] ."); \n"; $out .= "marker" . $counter . ".title = @\"" . $name . "\"; \n"; $out .= "marker" . $counter . ".map = mapView_; \n"; $out .= "marker" . $counter . ".icon = [UIImage imageNamed:@\"wc.png\"]; \n \n"; $res .= $out; } echo '<textarea style="width:500px; height: 300px">' . $res . '</textarea>'; } ?> </body> </html>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 8
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 61
Branch analysis from position: 11
2 jumps found. (Code = 77) Position 1 = 20, Position 2 = 57
Branch analysis from position: 20
2 jumps found. (Code = 78) Position 1 = 21, Position 2 = 57
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
Branch analysis from position: 57
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 57
Branch analysis from position: 61
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 61
Branch analysis from position: 11
Branch analysis from position: 61
filename:       /in/FTfum
function name:  (null)
number of ops:  63
compiled vars:  !0 = $data, !1 = $d, !2 = $res, !3 = $counter, !4 = $v, !5 = $k, !6 = $name, !7 = $point, !8 = $out
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    1     0  E >   ECHO                                                     '%3C%21DOCTYPE+html%3E%0A%3Chtml%3E%0A++++%3Chead%3E%0A++++++++%3Cmeta+http-equiv%3D%22Content-Type%22+content%3D%22text%2Fhtml%3B+charset%3DUTF-8%22+%2F%3E%0A++++%3C%2Fhead%3E%0A++++%3Cbody%3E%0A%0A++++++++%3Cform+method%3D%22post%22%3E%0A++++++++++++%3Ctextarea+name%3D%22data%22+style%3D%22width%3A+100%25%3B+height%3A+300px%22%3E%3C%2Ftextarea%3E%0A++++++++++++%3Cinput+type%3D%22submit%22%3E%0A++++++++%3C%2Fform%3E%0A'
   14     1        FETCH_IS                                         ~9      '_POST'
          2        ISSET_ISEMPTY_DIM_OBJ                         0          ~9, 'data'
          3      > JMPZ                                                     ~10, ->8
   15     4    >   FETCH_R                      global              ~11     '_POST'
          5        FETCH_DIM_R                                      ~12     ~11, 'data'
          6        QM_ASSIGN                                        ~13     ~12
          7      > JMP                                                      ->9
   16     8    >   QM_ASSIGN                                        ~13     ''
   14     9    >   ASSIGN                                                   !0, ~13
   17    10      > JMPZ                                                     !0, ->61
   19    11    >   DECLARE_FUNCTION                                         'parse'
   43    12        INIT_FCALL_BY_NAME                                       'parse'
         13        SEND_VAR_EX                                              !0
         14        DO_FCALL                                      0  $15     
         15        ASSIGN                                                   !1, $15
   45    16        ASSIGN                                                   !2, ''
   47    17        ASSIGN                                                   !3, 0
   49    18        FETCH_DIM_R                                      ~19     !1, 'name'
         19      > FE_RESET_R                                       $20     ~19, ->57
         20    > > FE_FETCH_R                                       ~21     $20, !4, ->57
         21    >   ASSIGN                                                   !5, ~21
   50    22        ASSIGN                                                   !6, !4
   51    23        INIT_FCALL                                               'explode'
         24        SEND_VAL                                                 '%2C'
         25        FETCH_DIM_R                                      ~24     !1, 'coord'
         26        FETCH_DIM_R                                      ~25     ~24, !5
         27        CAST                                          6  ~26     ~25
         28        SEND_VAL                                                 ~26
         29        DO_ICALL                                         $27     
         30        ASSIGN                                                   !7, $27
   53    31        POST_INC                                         ~29     !3
         32        CONCAT                                           ~30     'GMSMarker%2Amarker', ~29
         33        CONCAT                                           ~31     ~30, '%3D+%5B%5BGMSMarker+alloc%5D+init%5D%3B+%0A'
         34        ASSIGN                                                   !8, ~31
   54    35        CONCAT                                           ~33     'marker', !3
         36        CONCAT                                           ~34     ~33, '.position+%3D+CLLocationCoordinate2DMake%28'
         37        FETCH_DIM_R                                      ~35     !7, 1
         38        CONCAT                                           ~36     ~34, ~35
         39        CONCAT                                           ~37     ~36, '%2C'
         40        FETCH_DIM_R                                      ~38     !7, 0
         41        CONCAT                                           ~39     ~37, ~38
         42        CONCAT                                           ~40     ~39, '%29%3B+%0A'
         43        ASSIGN_OP                                     8          !8, ~40
   55    44        CONCAT                                           ~42     'marker', !3
         45        CONCAT                                           ~43     ~42, '.title+%3D+%40%22'
         46        CONCAT                                           ~44     ~43, !6
         47        CONCAT                                           ~45     ~44, '%22%3B+%0A'
         48        ASSIGN_OP                                     8          !8, ~45
   56    49        CONCAT                                           ~47     'marker', !3
         50        CONCAT                                           ~48     ~47, '.map+%3D+mapView_%3B+%0A'
         51        ASSIGN_OP                                     8          !8, ~48
   57    52        CONCAT                                           ~50     'marker', !3
         53        CONCAT                                           ~51     ~50, '.icon+%3D+%5BUIImage+imageNamed%3A%40%22wc.png%22%5D%3B+%0A+%0A'
         54        ASSIGN_OP                                     8          !8, ~51
   59    55        ASSIGN_OP                                     8          !2, !8
   49    56      > JMP                                                      ->20
         57    >   FE_FREE                                                  $20
   62    58        CONCAT                                           ~54     '%3Ctextarea+style%3D%22width%3A500px%3B+height%3A+300px%22%3E', !2
         59        CONCAT                                           ~55     ~54, '%3C%2Ftextarea%3E'
         60        ECHO                                                     ~55
   66    61    >   ECHO                                                     '%0A++++%3C%2Fbody%3E%0A%3C%2Fhtml%3E'
   68    62      > RETURN                                                   1

Function %00parse%2Fin%2FFTfum%3A19%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FTfum
function name:  parse
number of ops:  21
compiled vars:  !0 = $text, !1 = $foundName, !2 = $foundCoord
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   RECV                                             !0      
   20     1        BIND_GLOBAL                                              !1, 'foundName'
   21     2        BIND_GLOBAL                                              !2, 'foundCoord'
   22     3        ASSIGN                                                   !1, <array>
   23     4        ASSIGN                                                   !2, <array>
   25     5        INIT_FCALL                                               'preg_replace_callback'
          6        SEND_VAL                                                 '%23%5C%3CPlacemark+%28.%2B%3F%29%5C%3C%5C%2Fname%5C%3E%23msi'
   26     7        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FFTfum%3A26%241'
   30     8        SEND_VAL                                                 ~5
   31     9        SEND_VAR                                                 !0
         10        DO_ICALL                                                 
   33    11        INIT_FCALL                                               'preg_replace_callback'
         12        SEND_VAL                                                 '%23%5C%3Ccoordinates%5C%3E%28.%2B%3F%29%5C%3C%5C%2Fcoordinates%5C%3E%23msi'
   34    13        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FFTfum%3A34%242'
   37    14        SEND_VAL                                                 ~7
   38    15        SEND_VAR                                                 !0
         16        DO_ICALL                                                 
   40    17        INIT_ARRAY                                       ~9      !1, 'name'
         18        ADD_ARRAY_ELEMENT                                ~9      !2, 'coord'
         19      > RETURN                                                   ~9
   41    20*     > RETURN                                                   null

End of function %00parse%2Fin%2FFTfum%3A19%240

Function %00%7Bclosure%7D%2Fin%2FFTfum%3A26%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FTfum
function name:  {closure}
number of ops:  14
compiled vars:  !0 = $matches, !1 = $foundName, !2 = $ex
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   RECV                                             !0      
   27     1        BIND_GLOBAL                                              !1, 'foundName'
   28     2        INIT_FCALL                                               'explode'
          3        SEND_VAL                                                 '%3E'
          4        FETCH_DIM_R                                      ~3      !0, 1
          5        SEND_VAL                                                 ~3
          6        DO_ICALL                                         $4      
          7        ASSIGN                                                   !2, $4
   29     8        INIT_FCALL                                               'end'
          9        SEND_REF                                                 !2
         10        DO_ICALL                                         $7      
         11        ASSIGN_DIM                                               !1
         12        OP_DATA                                                  $7
   30    13      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FFTfum%3A26%241

Function %00%7Bclosure%7D%2Fin%2FFTfum%3A34%242:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FTfum
function name:  {closure}
number of ops:  6
compiled vars:  !0 = $matches, !1 = $foundCoord
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   34     0  E >   RECV                                             !0      
   35     1        BIND_GLOBAL                                              !1, 'foundCoord'
   36     2        FETCH_DIM_R                                      ~3      !0, 1
          3        ASSIGN_DIM                                               !1
          4        OP_DATA                                                  ~3
   37     5      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FFTfum%3A34%242

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.93 ms | 1408 KiB | 19 Q