3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = 'Visit [my page](http://example.com/posts/), %http://example.com%'; $search = 'http://example.com'; $dehydrated = strtr($text, ['%' => '%%', $search => '%WEBSITE_URL%']); $replace = 'http://another-site.net'; $rehydrated = strtr($dehydrated, ['%%' => '%', '%WEBSITE_URL%' => $replace]); echo $rehydrated;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/M3Qkf
function name:  (null)
number of ops:  19
compiled vars:  !0 = $text, !1 = $search, !2 = $dehydrated, !3 = $replace, !4 = $rehydrated
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'Visit+%5Bmy+page%5D%28http%3A%2F%2Fexample.com%2Fposts%2F%29%2C+%25http%3A%2F%2Fexample.com%25'
    5     1        ASSIGN                                                   !1, 'http%3A%2F%2Fexample.com'
    6     2        INIT_FCALL                                               'strtr'
          3        SEND_VAR                                                 !0
          4        INIT_ARRAY                                       ~7      '%25%25', '%25'
          5        ADD_ARRAY_ELEMENT                                ~7      '%25WEBSITE_URL%25', !1
          6        SEND_VAL                                                 ~7
          7        DO_ICALL                                         $8      
          8        ASSIGN                                                   !2, $8
    8     9        ASSIGN                                                   !3, 'http%3A%2F%2Fanother-site.net'
    9    10        INIT_FCALL                                               'strtr'
         11        SEND_VAR                                                 !2
         12        INIT_ARRAY                                       ~11     '%25', '%25%25'
         13        ADD_ARRAY_ELEMENT                                ~11     !3, '%25WEBSITE_URL%25'
         14        SEND_VAL                                                 ~11
         15        DO_ICALL                                         $12     
         16        ASSIGN                                                   !4, $12
   11    17        ECHO                                                     !4
   12    18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.34 ms | 1004 KiB | 14 Q