3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "This is my string but it also has %APP:name_of_the_app|ID:123123123% a bunch of other stuff in it"; $apps = array(); if (preg_match_all("/%APP:(.*?)\|ID:([0-9]+)%/", $string, $matches)) { for ($i = 0; $i < count($matches[0]); $i++) { $apps[] = array( "name" => $matches[1][$i], "id" => $matches[2][$i] ); } } print_r($apps);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 23
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
2 jumps found. (Code = 44) Position 1 = 23, Position 2 = 10
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 23, Position 2 = 10
Branch analysis from position: 23
Branch analysis from position: 10
Branch analysis from position: 23
filename:       /in/GRpZt
function name:  (null)
number of ops:  27
compiled vars:  !0 = $string, !1 = $apps, !2 = $matches, !3 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'This+is+my+string+but+it+also+has+%25APP%3Aname_of_the_app%7CID%3A123123123%25+a+bunch+of+other+stuff+in+it'
    4     1        ASSIGN                                                   !1, <array>
    5     2        INIT_FCALL                                               'preg_match_all'
          3        SEND_VAL                                                 '%2F%25APP%3A%28.%2A%3F%29%5C%7CID%3A%28%5B0-9%5D%2B%29%25%2F'
          4        SEND_VAR                                                 !0
          5        SEND_REF                                                 !2
          6        DO_ICALL                                         $6      
          7      > JMPZ                                                     $6, ->23
    6     8    >   ASSIGN                                                   !3, 0
          9      > JMP                                                      ->19
    8    10    >   FETCH_DIM_R                                      ~9      !2, 1
         11        FETCH_DIM_R                                      ~10     ~9, !3
         12        INIT_ARRAY                                       ~11     ~10, 'name'
    9    13        FETCH_DIM_R                                      ~12     !2, 2
         14        FETCH_DIM_R                                      ~13     ~12, !3
         15        ADD_ARRAY_ELEMENT                                ~11     ~13, 'id'
    7    16        ASSIGN_DIM                                               !1
    9    17        OP_DATA                                                  ~11
    6    18        PRE_INC                                                  !3
         19    >   FETCH_DIM_R                                      ~15     !2, 0
         20        COUNT                                            ~16     ~15
         21        IS_SMALLER                                               !3, ~16
         22      > JMPNZ                                                    ~17, ->10
   13    23    >   INIT_FCALL                                               'print_r'
         24        SEND_VAR                                                 !1
         25        DO_ICALL                                                 
         26      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.57 ms | 1396 KiB | 17 Q