3v4l.org

run code in 300+ PHP versions simultaneously
<?php $rx = '~(?|(?:youtube(?:-nocookie)?\.com/(?:[^/]+/.+/|(?:v|e(?:mbed)?)/|.*[?&]v=)|youtu\.be/)([^"&?/ ]{11})|vimeo\.com/(?:[a-z]+/)*([0-9]{6,11}))~'; $s = 'https://vimeo.com/341989332 or https://www.youtube.com/watch?v=eUMbH6X_Adc'; if (preg_match_all($rx, $s, $m)) { print_r($m[1]); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 12
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/H7HMA
function name:  (null)
number of ops:  13
compiled vars:  !0 = $rx, !1 = $s, !2 = $m
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%7E%28%3F%7C%28%3F%3Ayoutube%28%3F%3A-nocookie%29%3F%5C.com%2F%28%3F%3A%5B%5E%2F%5D%2B%2F.%2B%2F%7C%28%3F%3Av%7Ce%28%3F%3Ambed%29%3F%29%2F%7C.%2A%5B%3F%26%5Dv%3D%29%7Cyoutu%5C.be%2F%29%28%5B%5E%22%26%3F%2F+%5D%7B11%7D%29%7Cvimeo%5C.com%2F%28%3F%3A%5Ba-z%5D%2B%2F%29%2A%28%5B0-9%5D%7B6%2C11%7D%29%29%7E'
    4     1        ASSIGN                                                   !1, 'https%3A%2F%2Fvimeo.com%2F341989332+or+https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DeUMbH6X_Adc'
    5     2        INIT_FCALL                                               'preg_match_all'
          3        SEND_VAR                                                 !0
          4        SEND_VAR                                                 !1
          5        SEND_REF                                                 !2
          6        DO_ICALL                                         $5      
          7      > JMPZ                                                     $5, ->12
    6     8    >   INIT_FCALL                                               'print_r'
          9        FETCH_DIM_R                                      ~6      !2, 1
         10        SEND_VAL                                                 ~6
         11        DO_ICALL                                                 
    7    12    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
259.63 ms | 1010 KiB | 15 Q