3v4l.org

run code in 300+ PHP versions simultaneously
<?php function _getYoutubeVideoId($url) { if (preg_match('%(?:youtube(?:-nocookie)?\.com/(?:[^/]+/.+/|(?:v|e(?:mbed)?)/|.*[?&]v=)|youtu\.be/)([^"&?/ ]{11})%i', $url, $match)) { return $match[1]; } } var_dump(_getYoutubeVideoId("http://www.youtube.com/watch?v=U0Yh08JnOZE"));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Thmbc
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               '_getyoutubevideoid'
          2        SEND_VAL                                                 'http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DU0Yh08JnOZE'
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                                 
          6      > RETURN                                                   1

Function _getyoutubevideoid:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 9
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Thmbc
function name:  _getYoutubeVideoId
number of ops:  10
compiled vars:  !0 = $url, !1 = $match
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        INIT_FCALL                                               'preg_match'
          2        SEND_VAL                                                 '%25%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%25i'
          3        SEND_VAR                                                 !0
          4        SEND_REF                                                 !1
          5        DO_ICALL                                         $2      
          6      > JMPZ                                                     $2, ->9
    6     7    >   FETCH_DIM_R                                      ~3      !1, 1
          8      > RETURN                                                   ~3
    8     9    > > RETURN                                                   null

End of function _getyoutubevideoid

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.99 ms | 1389 KiB | 18 Q