3v4l.org

run code in 300+ PHP versions simultaneously
<?php $message = " [xxxStudent.address_1xxx][xxxStudent.address_2xxx][xxxStudent.address_3xxx] [xxxStudent.townxxx] [xxxStudent.countyxxx] [xxxStudent.postcodexxx] [xxxStudent.country_iso_2xxx]"; preg_match_all('/\[xxx(\w+[\.+\w+]+)xxx\]/', $message, $tags, PREG_SET_ORDER); foreach ($tags as $tag) { $tag_parts = explode('.', $tag[1]); if (count($tag_parts) == 1) { $tag_model = null; $tag_field = $tag[1]; } else if(count($tag_parts) == 2) { $tag_model = $tag_parts[0]; $tag_field = $tag_parts[1]; } var_dump($tag_model); var_dump($tag_field); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 36
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 36
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 22
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 29
Branch analysis from position: 29
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 22
2 jumps found. (Code = 43) Position 1 = 25, Position 2 = 29
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 29
Branch analysis from position: 36
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 36
filename:       /in/qE1c6
function name:  (null)
number of ops:  38
compiled vars:  !0 = $message, !1 = $tags, !2 = $tag, !3 = $tag_parts, !4 = $tag_model, !5 = $tag_field
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%0A%5BxxxStudent.address_1xxx%5D%5BxxxStudent.address_2xxx%5D%5BxxxStudent.address_3xxx%5D%0A%5BxxxStudent.townxxx%5D%0A%5BxxxStudent.countyxxx%5D%0A%5BxxxStudent.postcodexxx%5D%0A%5BxxxStudent.country_iso_2xxx%5D'
   10     1        INIT_FCALL                                               'preg_match_all'
          2        SEND_VAL                                                 '%2F%5C%5Bxxx%28%5Cw%2B%5B%5C.%2B%5Cw%2B%5D%2B%29xxx%5C%5D%2F'
          3        SEND_VAR                                                 !0
          4        SEND_REF                                                 !1
          5        SEND_VAL                                                 2
          6        DO_ICALL                                                 
   12     7      > FE_RESET_R                                       $8      !1, ->36
          8    > > FE_FETCH_R                                               $8, !2, ->36
   13     9    >   INIT_FCALL                                               'explode'
         10        SEND_VAL                                                 '.'
         11        FETCH_DIM_R                                      ~9      !2, 1
         12        SEND_VAL                                                 ~9
         13        DO_ICALL                                         $10     
         14        ASSIGN                                                   !3, $10
   14    15        COUNT                                            ~12     !3
         16        IS_EQUAL                                                 ~12, 1
         17      > JMPZ                                                     ~13, ->22
   15    18    >   ASSIGN                                                   !4, null
   16    19        FETCH_DIM_R                                      ~15     !2, 1
         20        ASSIGN                                                   !5, ~15
         21      > JMP                                                      ->29
   17    22    >   COUNT                                            ~17     !3
         23        IS_EQUAL                                                 ~17, 2
         24      > JMPZ                                                     ~18, ->29
   18    25    >   FETCH_DIM_R                                      ~19     !3, 0
         26        ASSIGN                                                   !4, ~19
   19    27        FETCH_DIM_R                                      ~21     !3, 1
         28        ASSIGN                                                   !5, ~21
   22    29    >   INIT_FCALL                                               'var_dump'
         30        SEND_VAR                                                 !4
         31        DO_ICALL                                                 
   23    32        INIT_FCALL                                               'var_dump'
         33        SEND_VAR                                                 !5
         34        DO_ICALL                                                 
   12    35      > JMP                                                      ->8
         36    >   FE_FREE                                                  $8
   24    37      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.68 ms | 1400 KiB | 19 Q