3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = '<{$headtype} class="{$class}">{$text}</{$headtype}>'; $array['headtype'] = 'h1'; $array['class'] = 'classname'; $array['text'] = 'the title'; foreach ($array as $key => $value) { $html = str_replace('{$'.$key.'}', $value, $html); } echo $html;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 19
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 19
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/PceWI
function name:  (null)
number of ops:  22
compiled vars:  !0 = $html, !1 = $array, !2 = $value, !3 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, '%3C%7B%24headtype%7D+class%3D%22%7B%24class%7D%22%3E%7B%24text%7D%3C%2F%7B%24headtype%7D%3E'
    5     1        ASSIGN_DIM                                               !1, 'headtype'
          2        OP_DATA                                                  'h1'
    6     3        ASSIGN_DIM                                               !1, 'class'
          4        OP_DATA                                                  'classname'
    7     5        ASSIGN_DIM                                               !1, 'text'
          6        OP_DATA                                                  'the+title'
    9     7      > FE_RESET_R                                       $8      !1, ->19
          8    > > FE_FETCH_R                                       ~9      $8, !2, ->19
          9    >   ASSIGN                                                   !3, ~9
   10    10        INIT_FCALL                                               'str_replace'
         11        CONCAT                                           ~11     '%7B%24', !3
         12        CONCAT                                           ~12     ~11, '%7D'
         13        SEND_VAL                                                 ~12
         14        SEND_VAR                                                 !2
         15        SEND_VAR                                                 !0
         16        DO_ICALL                                         $13     
         17        ASSIGN                                                   !0, $13
    9    18      > JMP                                                      ->8
         19    >   FE_FREE                                                  $8
   13    20        ECHO                                                     !0
         21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
139.46 ms | 998 KiB | 14 Q