3v4l.org

run code in 300+ PHP versions simultaneously
<?php $video = "https://www.youtube.com/watch?v=9g30pPikveg&feature=youtu.be"; $replace = str_replace('&feature=', '', $video); echo $replace; $pattern = '#https?://(?:www\.)?youtube\.com/watch\?v=#'; $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/crKDC
function name:  (null)
number of ops:  17
compiled vars:  !0 = $video, !1 = $replace, !2 = $pattern, !3 = $replacement, !4 = $final
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D9g30pPikveg%26feature%3Dyoutu.be'
    3     1        INIT_FCALL                                               'str_replace'
          2        SEND_VAL                                                 '%26feature%3D'
          3        SEND_VAL                                                 ''
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $6      
          6        ASSIGN                                                   !1, $6
    4     7        ECHO                                                     !1
    5     8        ASSIGN                                                   !2, '%23https%3F%3A%2F%2F%28%3F%3Awww%5C.%29%3Fyoutube%5C.com%2Fwatch%5C%3Fv%3D%23'
    6     9        ASSIGN                                                   !3, 'http%3A%2F%2Fwww.youtube.com%2Fembed%2F'
    7    10        INIT_FCALL                                               'preg_replace'
         11        SEND_VAR                                                 !2
         12        SEND_VAR                                                 !3
         13        SEND_VAR                                                 !0
         14        DO_ICALL                                         $10     
         15        ASSIGN                                                   !4, $10
    8    16      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.52 ms | 1394 KiB | 17 Q