3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "{uuid}/{filename}"; $data = array("uuid" => "derp", "filename" => "foo"); foreach ($data as $key => $val){ echo "{".$key."}".PHP_EOL; echo $val.PHP_EOL; $string = str_replace($val, "{".$key."}", $string); } echo $string;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 20
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 20
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
filename:       /in/2jAk4
function name:  (null)
number of ops:  23
compiled vars:  !0 = $string, !1 = $data, !2 = $val, !3 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%7Buuid%7D%2F%7Bfilename%7D'
    4     1        ASSIGN                                                   !1, <array>
    5     2      > FE_RESET_R                                       $6      !1, ->20
          3    > > FE_FETCH_R                                       ~7      $6, !2, ->20
          4    >   ASSIGN                                                   !3, ~7
    6     5        CONCAT                                           ~9      '%7B', !3
          6        CONCAT                                           ~10     ~9, '%7D'
          7        CONCAT                                           ~11     ~10, '%0A'
          8        ECHO                                                     ~11
    7     9        CONCAT                                           ~12     !2, '%0A'
         10        ECHO                                                     ~12
    8    11        INIT_FCALL                                               'str_replace'
         12        SEND_VAR                                                 !2
         13        CONCAT                                           ~13     '%7B', !3
         14        CONCAT                                           ~14     ~13, '%7D'
         15        SEND_VAL                                                 ~14
         16        SEND_VAR                                                 !0
         17        DO_ICALL                                         $15     
         18        ASSIGN                                                   !0, $15
    5    19      > JMP                                                      ->3
         20    >   FE_FREE                                                  $6
   11    21        ECHO                                                     !0
         22      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.91 ms | 1395 KiB | 15 Q