3v4l.org

run code in 300+ 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('~<!-- @@include\s+\K\w+=".*?"(?:\s+\w+=".*?")*~', $str, $matches) ) { foreach ($matches[0] as $params) { if ( preg_match_all('~(\w+)="(.*?)"~', $params, $keyvals) ) $result[] = array_combine($keyvals[1], $keyvals[2]); } } print_r($result);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 27
Branch analysis from position: 8
2 jumps found. (Code = 77) Position 1 = 10, Position 2 = 26
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 26
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 25
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 25
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 26
Branch analysis from position: 27
filename:       /in/0uCBn
function name:  (null)
number of ops:  31
compiled vars:  !0 = $str, !1 = $result, !2 = $matches, !3 = $params, !4 = $keyvals
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%3C%21--+%40%40include%5Cs%2B%5CK%5Cw%2B%3D%22.%2A%3F%22%28%3F%3A%5Cs%2B%5Cw%2B%3D%22.%2A%3F%22%29%2A%7E'
          4        SEND_VAR                                                 !0
          5        SEND_REF                                                 !2
          6        DO_ICALL                                         $7      
          7      > JMPZ                                                     $7, ->27
   17     8    >   FETCH_DIM_R                                      ~8      !2, 0
          9      > FE_RESET_R                                       $9      ~8, ->26
         10    > > FE_FETCH_R                                               $9, !3, ->26
   18    11    >   INIT_FCALL                                               'preg_match_all'
         12        SEND_VAL                                                 '%7E%28%5Cw%2B%29%3D%22%28.%2A%3F%29%22%7E'
         13        SEND_VAR                                                 !3
         14        SEND_REF                                                 !4
         15        DO_ICALL                                         $10     
         16      > JMPZ                                                     $10, ->25
   19    17    >   INIT_FCALL                                               'array_combine'
         18        FETCH_DIM_R                                      ~12     !4, 1
         19        SEND_VAL                                                 ~12
         20        FETCH_DIM_R                                      ~13     !4, 2
         21        SEND_VAL                                                 ~13
         22        DO_ICALL                                         $14     
         23        ASSIGN_DIM                                               !1
         24        OP_DATA                                                  $14
   17    25    > > JMP                                                      ->10
         26    >   FE_FREE                                                  $9
   23    27    >   INIT_FCALL                                               'print_r'
         28        SEND_VAR                                                 !1
         29        DO_ICALL                                                 
         30      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
127.92 ms | 1405 KiB | 19 Q