3v4l.org

run code in 300+ PHP versions simultaneously
<?php function contentBeforeLoop($content) { $array = ['Hello', 'World', '!']; foreach($array as $item) { $content = str_replace('$item', $item, $content); echo $content . "\n"; $content = str_replace($item, '$item', $content); } } contentBeforeLoop('item: $item');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vl1co
function name:  (null)
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   INIT_FCALL                                               'contentbeforeloop'
          1        SEND_VAL                                                 'item%3A+%24item'
          2        DO_FCALL                                      0          
          3      > RETURN                                                   1

Function contentbeforeloop:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 19
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 19
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/vl1co
function name:  contentBeforeLoop
number of ops:  21
compiled vars:  !0 = $content, !1 = $array, !2 = $item
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        ASSIGN                                                   !1, <array>
    7     2      > FE_RESET_R                                       $4      !1, ->19
          3    > > FE_FETCH_R                                               $4, !2, ->19
    9     4    >   INIT_FCALL                                               'str_replace'
          5        SEND_VAL                                                 '%24item'
          6        SEND_VAR                                                 !2
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                         $5      
          9        ASSIGN                                                   !0, $5
   10    10        CONCAT                                           ~7      !0, '%0A'
         11        ECHO                                                     ~7
   11    12        INIT_FCALL                                               'str_replace'
         13        SEND_VAR                                                 !2
         14        SEND_VAL                                                 '%24item'
         15        SEND_VAR                                                 !0
         16        DO_ICALL                                         $8      
         17        ASSIGN                                                   !0, $8
    7    18      > JMP                                                      ->3
         19    >   FE_FREE                                                  $4
   15    20      > RETURN                                                   null

End of function contentbeforeloop

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
183.19 ms | 1399 KiB | 16 Q