3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr =['img src="images/Selection_005.png"', 'img src="images/Selection_006.png"']; $find = "images"; $replace ="/documents/20143/0"; Foreach($arr as $link){ Echo str_replace($find, $replace, $link) ."\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 13
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 13
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
filename:       /in/0ZT9e
function name:  (null)
number of ops:  15
compiled vars:  !0 = $arr, !1 = $find, !2 = $replace, !3 = $link
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    6     1        ASSIGN                                                   !1, 'images'
    7     2        ASSIGN                                                   !2, '%2Fdocuments%2F20143%2F0'
    9     3      > FE_RESET_R                                       $7      !0, ->13
          4    > > FE_FETCH_R                                               $7, !3, ->13
   10     5    >   INIT_FCALL                                               'str_replace'
          6        SEND_VAR                                                 !1
          7        SEND_VAR                                                 !2
          8        SEND_VAR                                                 !3
          9        DO_ICALL                                         $8      
         10        CONCAT                                           ~9      $8, '%0A'
         11        ECHO                                                     ~9
    9    12      > JMP                                                      ->4
         13    >   FE_FREE                                                  $7
   11    14      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.63 ms | 1009 KiB | 14 Q