3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = "lorem ipsum doler sit amet. Amet ipsum doleram paradem"; $find = "lorem|ipsum"; $find = explode('|', $find); Foreach($find as $f){ $replace[] = "{" . $f . "}"; } $newString = str_replace($find, $replace, $str); Echo $newString;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 14
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 14
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
filename:       /in/DOB2F
function name:  (null)
number of ops:  23
compiled vars:  !0 = $str, !1 = $find, !2 = $f, !3 = $replace, !4 = $newString
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'lorem+ipsum+doler+sit+amet.+Amet+ipsum+doleram+paradem'
    6     1        ASSIGN                                                   !1, 'lorem%7Cipsum'
    7     2        INIT_FCALL                                               'explode'
          3        SEND_VAL                                                 '%7C'
          4        SEND_VAR                                                 !1
          5        DO_ICALL                                         $7      
          6        ASSIGN                                                   !1, $7
    8     7      > FE_RESET_R                                       $9      !1, ->14
          8    > > FE_FETCH_R                                               $9, !2, ->14
    9     9    >   CONCAT                                           ~11     '%7B', !2
         10        CONCAT                                           ~12     ~11, '%7D'
         11        ASSIGN_DIM                                               !3
         12        OP_DATA                                                  ~12
    8    13      > JMP                                                      ->8
         14    >   FE_FREE                                                  $9
   12    15        INIT_FCALL                                               'str_replace'
         16        SEND_VAR                                                 !1
         17        SEND_VAR                                                 !3
         18        SEND_VAR                                                 !0
         19        DO_ICALL                                         $13     
         20        ASSIGN                                                   !4, $13
   13    21        ECHO                                                     !4
   14    22      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154 ms | 1011 KiB | 15 Q