3v4l.org

run code in 500+ PHP versions simultaneously
<?php $str = <<<'EOD' At vero eos et accusamus et iusto odio dignissimos ducimus <!-- @@include default="/admin/creditapp/templates/longform/" try="/wTemplates/forms/templates/" file="credit_row_1.txt" --> qui blanditiis praesentium voluptatum deleniti atque corrupti <!-- @@include default="/admin/creditapp/templates/longform/" try="/wTemplates/forms/templates/" file="credit_row_2.txt" --> quos dolores et quas excepturi sint EOD; $result = []; if ( preg_match_all('~(?:\G(?!\A)|<!-- (@)@include)\s+(try|default|file)="(.*?)"~', $str, $matches, PREG_SET_ORDER) ) { foreach ($matches as $m) { if ( !empty($m[1]) ) { if ( isset($temp) ) $result[] = $temp; $temp=[]; } $temp[$m[2]] = $m[3]; } } if ( isset($temp) ) $result[] = $temp; print_r($result);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 25
Branch analysis from position: 9
2 jumps found. (Code = 77) Position 1 = 10, Position 2 = 24
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 24
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 19
Branch analysis from position: 14
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 18
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 18
Branch analysis from position: 19
Branch analysis from position: 24
2 jumps found. (Code = 43) Position 1 = 27, Position 2 = 29
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 29
Branch analysis from position: 24
Branch analysis from position: 25
filename:       /in/vM79h
function name:  (null)
number of ops:  33
compiled vars:  !0 = $str, !1 = $result, !2 = $matches, !3 = $m, !4 = $temp
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                       !0, 'At+vero+eos+et+accusamus+et+iusto+odio+dignissimos+ducimus%0A%0A%3C%21--+%40%40include+default%3D%22%2Fadmin%2Fcreditapp%2Ftemplates%2Flongform%2F%22+try%3D%22%2FwTemplates%2Fforms%2Ftemplates%2F%22+file%3D%22credit_row_1.txt%22+--%3E%0A%0Aqui+blanditiis+praesentium+voluptatum+deleniti+atque+corrupti%0A%0A%3C%21--+%40%40include+default%3D%22%2Fadmin%2Fcreditapp%2Ftemplates%2Flongform%2F%22+try%3D%22%2FwTemplates%2Fforms%2Ftemplates%2F%22+file%3D%22credit_row_2.txt%22+--%3E%0A%0Aquos+dolores+et+quas+excepturi+sint'
   14     1        ASSIGN                                                       !1, <array>
   16     2        INIT_FCALL                                                   'preg_match_all'
          3        SEND_VAL                                                     '%7E%28%3F%3A%5CG%28%3F%21%5CA%29%7C%3C%21--+%28%40%29%40include%29%5Cs%2B%28try%7Cdefault%7Cfile%29%3D%22%28.%2A%3F%29%22%7E'
          4        SEND_VAR                                                     !0
          5        SEND_REF                                                     !2
          6        SEND_VAL                                                     2
          7        DO_ICALL                                             $7      
          8      > JMPZ                                                         $7, ->25
   17     9    > > FE_RESET_R                                           $8      !2, ->24
         10    > > FE_FETCH_R                                                   $8, !3, ->24
   18    11    >   ISSET_ISEMPTY_DIM_OBJ                             1  ~9      !3, 1
         12        BOOL_NOT                                             ~10     ~9
         13      > JMPZ                                                         ~10, ->19
   19    14    >   ISSET_ISEMPTY_CV                                             !4
         15      > JMPZ                                                         ~11, ->18
   20    16    >   ASSIGN_DIM                                                   !1
         17        OP_DATA                                                      !4
   21    18    >   ASSIGN                                                       !4, <array>
   23    19    >   FETCH_DIM_R                                          ~14     !3, 2
         20        FETCH_DIM_R                                          ~16     !3, 3
         21        ASSIGN_DIM                                                   !4, ~14
         22        OP_DATA                                                      ~16
   17    23      > JMP                                                          ->10
         24    >   FE_FREE                                                      $8
   27    25    >   ISSET_ISEMPTY_CV                                             !4
         26      > JMPZ                                                         ~17, ->29
   28    27    >   ASSIGN_DIM                                                   !1
         28        OP_DATA                                                      !4
   30    29    >   INIT_FCALL                                                   'print_r'
         30        SEND_VAR                                                     !1
         31        DO_ICALL                                                     
         32      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
163.99 ms | 2696 KiB | 15 Q