3v4l.org

run code in 300+ PHP versions simultaneously
<?php $tst = '!!!!'; $a = '@@@'; $template = '{{$tst}}test{{$a}}'; if (preg_match_all("/{{(.*?)}}/", $template, $m)) { foreach ($m[1] as $i => $varname) { echo strval($$varname).PHP_EOL.$m[0][$i].'===='.sprintf('$%s', $varname).PHP_EOL; //$template = str_replace($m[0][$i], ${$varname}, $template); } } $x = '###'.strval($a).PHP_EOL; echo $x; echo $template;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 29
Branch analysis from position: 9
2 jumps found. (Code = 77) Position 1 = 11, Position 2 = 28
Branch analysis from position: 11
2 jumps found. (Code = 78) Position 1 = 12, Position 2 = 28
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
Branch analysis from position: 29
filename:       /in/h4JfX
function name:  (null)
number of ops:  36
compiled vars:  !0 = $tst, !1 = $a, !2 = $template, !3 = $m, !4 = $varname, !5 = $i, !6 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%21%21%21%21'
    4     1        ASSIGN                                                   !1, '%40%40%40'
    5     2        ASSIGN                                                   !2, '%7B%7B%24tst%7D%7Dtest%7B%7B%24a%7D%7D'
    7     3        INIT_FCALL                                               'preg_match_all'
          4        SEND_VAL                                                 '%2F%7B%7B%28.%2A%3F%29%7D%7D%2F'
          5        SEND_VAR                                                 !2
          6        SEND_REF                                                 !3
          7        DO_ICALL                                         $10     
          8      > JMPZ                                                     $10, ->29
    8     9    >   FETCH_DIM_R                                      ~11     !3, 1
         10      > FE_RESET_R                                       $12     ~11, ->28
         11    > > FE_FETCH_R                                       ~13     $12, !4, ->28
         12    >   ASSIGN                                                   !5, ~13
    9    13        FETCH_R                      local               ~15     !4
         14        CAST                                          6  ~16     ~15
         15        CONCAT                                           ~17     ~16, '%0A'
         16        FETCH_DIM_R                                      ~18     !3, 0
         17        FETCH_DIM_R                                      ~19     ~18, !5
         18        CONCAT                                           ~20     ~17, ~19
         19        CONCAT                                           ~21     ~20, '%3D%3D%3D%3D'
         20        INIT_FCALL                                               'sprintf'
         21        SEND_VAL                                                 '%24%25s'
         22        SEND_VAR                                                 !4
         23        DO_ICALL                                         $22     
         24        CONCAT                                           ~23     ~21, $22
         25        CONCAT                                           ~24     ~23, '%0A'
         26        ECHO                                                     ~24
    8    27      > JMP                                                      ->11
         28    >   FE_FREE                                                  $12
   13    29    >   CAST                                          6  ~25     !1
         30        CONCAT                                           ~26     '%23%23%23', ~25
         31        CONCAT                                           ~27     ~26, '%0A'
         32        ASSIGN                                                   !6, ~27
   14    33        ECHO                                                     !6
   15    34        ECHO                                                     !2
         35      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.92 ms | 1396 KiB | 17 Q