3v4l.org

run code in 500+ PHP versions simultaneously
<?php $re = '`\bhttps?\K(?=//)`m'; $str = 'https//example.com'; $subst = ':'; echo preg_replace($re, $subst, $str);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/eXa4d
function name:  (null)
number of ops:  7
compiled vars:  !0 = $re, !1 = $str, !2 = $subst
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, '%60%5Cbhttps%3F%5CK%28%3F%3D%2F%2F%29%60m'
    4     1        ASSIGN                                                       !1, 'https%2F%2Fexample.com'
    5     2        ASSIGN                                                       !2, '%3A'
    7     3        FRAMELESS_ICALL_3                preg_replace        ~6      !0, !2
          4        OP_DATA                                                      !1
          5        ECHO                                                         ~6
          6      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
198.28 ms | 1873 KiB | 13 Q