3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str1 = "/stuf/stuff.png"; $str2 = "moar/moar.jpg"; var_dum(preg_replace('/^([^\/])/', '/', $str1)); var_dum(preg_replace('/^([^\/])/', '/', $str2));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/R1Ipq
function name:  (null)
number of ops:  19
compiled vars:  !0 = $str1, !1 = $str2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%2Fstuf%2Fstuff.png'
    4     1        ASSIGN                                                   !1, 'moar%2Fmoar.jpg'
    6     2        INIT_FCALL_BY_NAME                                       'var_dum'
          3        INIT_FCALL                                               'preg_replace'
          4        SEND_VAL                                                 '%2F%5E%28%5B%5E%5C%2F%5D%29%2F'
          5        SEND_VAL                                                 '%2F'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $4      
          8        SEND_VAR_NO_REF_EX                                       $4
          9        DO_FCALL                                      0          
    7    10        INIT_FCALL_BY_NAME                                       'var_dum'
         11        INIT_FCALL                                               'preg_replace'
         12        SEND_VAL                                                 '%2F%5E%28%5B%5E%5C%2F%5D%29%2F'
         13        SEND_VAL                                                 '%2F'
         14        SEND_VAR                                                 !1
         15        DO_ICALL                                         $6      
         16        SEND_VAR_NO_REF_EX                                       $6
         17        DO_FCALL                                      0          
         18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.81 ms | 1394 KiB | 15 Q