3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = 'test //ita https://example.com lics// test // another // one'; $regex = '~(?<!https:|http:)//\s*((?:https?://|(?!//).)*)(?<!\s)\s*//~'; preg_match_all($regex, $text, $matches); var_export($matches[1]);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rn1Gi
function name:  (null)
number of ops:  12
compiled vars:  !0 = $text, !1 = $regex, !2 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'test+%2F%2Fita+https%3A%2F%2Fexample.com+lics%2F%2F+test+%2F%2F+another+%2F%2F+one'
    4     1        ASSIGN                                                   !1, '%7E%28%3F%3C%21https%3A%7Chttp%3A%29%2F%2F%5Cs%2A%28%28%3F%3Ahttps%3F%3A%2F%2F%7C%28%3F%21%2F%2F%29.%29%2A%29%28%3F%3C%21%5Cs%29%5Cs%2A%2F%2F%7E'
    5     2        INIT_FCALL                                               'preg_match_all'
          3        SEND_VAR                                                 !1
          4        SEND_VAR                                                 !0
          5        SEND_REF                                                 !2
          6        DO_ICALL                                                 
    6     7        INIT_FCALL                                               'var_export'
          8        FETCH_DIM_R                                      ~6      !2, 1
          9        SEND_VAL                                                 ~6
         10        DO_ICALL                                                 
         11      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.48 ms | 1013 KiB | 15 Q