3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = "lorem ipsum doler sit amet. Amet ipsum doleram paradem"; $find = "lorem|ipsum"; $replstr = "{" . str_replace("|", "}|{", $find) ."}"; $find = explode('|', $find); $replace = explode("|", $replstr); $newString = str_replace($find, $replace, $str); Echo $newString;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/E4O11
function name:  (null)
number of ops:  28
compiled vars:  !0 = $str, !1 = $find, !2 = $replstr, !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                                               'str_replace'
          3        SEND_VAL                                                 '%7C'
          4        SEND_VAL                                                 '%7D%7C%7B'
          5        SEND_VAR                                                 !1
          6        DO_ICALL                                         $7      
          7        CONCAT                                           ~8      '%7B', $7
          8        CONCAT                                           ~9      ~8, '%7D'
          9        ASSIGN                                                   !2, ~9
    8    10        INIT_FCALL                                               'explode'
         11        SEND_VAL                                                 '%7C'
         12        SEND_VAR                                                 !1
         13        DO_ICALL                                         $11     
         14        ASSIGN                                                   !1, $11
   10    15        INIT_FCALL                                               'explode'
         16        SEND_VAL                                                 '%7C'
         17        SEND_VAR                                                 !2
         18        DO_ICALL                                         $13     
         19        ASSIGN                                                   !3, $13
   13    20        INIT_FCALL                                               'str_replace'
         21        SEND_VAR                                                 !1
         22        SEND_VAR                                                 !3
         23        SEND_VAR                                                 !0
         24        DO_ICALL                                         $15     
         25        ASSIGN                                                   !4, $15
   14    26        ECHO                                                     !4
   15    27      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.86 ms | 1011 KiB | 15 Q