3v4l.org

run code in 300+ PHP versions simultaneously
<?php $regex = preg_quote('\\/', '/'); $str = 'https:\/\/example.com\/'; $replaced = preg_replace("/{$regex}/", '/', $str); var_dump($replaced);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0krAp
function name:  (null)
number of ops:  19
compiled vars:  !0 = $regex, !1 = $str, !2 = $replaced
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'preg_quote'
          1        SEND_VAL                                                 '%5C%2F'
          2        SEND_VAL                                                 '%2F'
          3        DO_ICALL                                         $3      
          4        ASSIGN                                                   !0, $3
    5     5        ASSIGN                                                   !1, 'https%3A%5C%2F%5C%2Fexample.com%5C%2F'
    7     6        INIT_FCALL                                               'preg_replace'
          7        ROPE_INIT                                     3  ~7      '%2F'
          8        ROPE_ADD                                      1  ~7      ~7, !0
          9        ROPE_END                                      2  ~6      ~7, '%2F'
         10        SEND_VAL                                                 ~6
         11        SEND_VAL                                                 '%2F'
         12        SEND_VAR                                                 !1
         13        DO_ICALL                                         $9      
         14        ASSIGN                                                   !2, $9
    9    15        INIT_FCALL                                               'var_dump'
         16        SEND_VAR                                                 !2
         17        DO_ICALL                                                 
         18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
130.39 ms | 999 KiB | 16 Q