3v4l.org

run code in 300+ PHP versions simultaneously
<?php $videoURLs = array( 'http://www.youtube.com/embed/VIDEO_ID', 'http://youtu.be/VIDEO_ID', 'http://www.youtube.com/v/VIDEO_ID', 'http://www.youtube.com/watch?v=VIDEO_ID', ); foreach ($videoURLs as $urlNow) { $url = parse_url($urlNow); #$url['path'] = str_replace(array('/v/', '/embed/', '/'), '', $url['path']); $videoID = $url['path']; if (isset($url['query'])) { parse_str($url['query'], $query); $videoID = $query['v']; } var_dump($urlNow, $videoID); } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 23
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 23
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 18
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 18
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
filename:       /in/FFOD6
function name:  (null)
number of ops:  25
compiled vars:  !0 = $videoURLs, !1 = $urlNow, !2 = $url, !3 = $videoID, !4 = $query
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    9     1      > FE_RESET_R                                       $6      !0, ->23
          2    > > FE_FETCH_R                                               $6, !1, ->23
   10     3    >   INIT_FCALL                                               'parse_url'
          4        SEND_VAR                                                 !1
          5        DO_ICALL                                         $7      
          6        ASSIGN                                                   !2, $7
   13     7        FETCH_DIM_R                                      ~9      !2, 'path'
          8        ASSIGN                                                   !3, ~9
   14     9        ISSET_ISEMPTY_DIM_OBJ                         0          !2, 'query'
         10      > JMPZ                                                     ~11, ->18
   15    11    >   INIT_FCALL                                               'parse_str'
         12        FETCH_DIM_R                                      ~12     !2, 'query'
         13        SEND_VAL                                                 ~12
         14        SEND_REF                                                 !4
         15        DO_ICALL                                                 
   16    16        FETCH_DIM_R                                      ~14     !4, 'v'
         17        ASSIGN                                                   !3, ~14
   19    18    >   INIT_FCALL                                               'var_dump'
         19        SEND_VAR                                                 !1
         20        SEND_VAR                                                 !3
         21        DO_ICALL                                                 
    9    22      > JMP                                                      ->2
         23    >   FE_FREE                                                  $6
   21    24      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.9 ms | 1387 KiB | 19 Q