3v4l.org

run code in 300+ PHP versions simultaneously
<?php $video = "https://youtu.be/9g30pPikveg"; $pattern = '#https?://(?:www\.)?youtu\.be/\/#'; $replacement = 'http://www.youtube.com/embed/'; $final = preg_replace($pattern, $replacement, $video); echo $final;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3QVZ0
function name:  (null)
number of ops:  11
compiled vars:  !0 = $video, !1 = $pattern, !2 = $replacement, !3 = $final
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'https%3A%2F%2Fyoutu.be%2F9g30pPikveg'
    3     1        ASSIGN                                                   !1, '%23https%3F%3A%2F%2F%28%3F%3Awww%5C.%29%3Fyoutu%5C.be%2F%5C%2F%23'
    4     2        ASSIGN                                                   !2, 'http%3A%2F%2Fwww.youtube.com%2Fembed%2F'
    5     3        INIT_FCALL                                               'preg_replace'
          4        SEND_VAR                                                 !1
          5        SEND_VAR                                                 !2
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $7      
          8        ASSIGN                                                   !3, $7
    6     9        ECHO                                                     !3
         10      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
176.08 ms | 1394 KiB | 15 Q