3v4l.org

run code in 300+ PHP versions simultaneously
<?php $_content = '<p class="post_content">[iframe width="256" height="175" src="http://www.youtube.com/embed/ICx3AfSlc-w" frameborder="0" allowfullscreen]</p> //www.youtu.be/asdlfkjad_1 https://www.youtube.com/watch?v=dZpc936_Hgo http://youtu.be/lvOFck4dn_8 http://vimeo.com/65484727 http://www.metacafe.com/watch/10599819/are_katy_perry_and_john_mayer_back_together http://www.dailymotion.com/video/xzdijh_hire-data-entry-expert_news <embed style="width:400px; height:326px;" wmode="opaque" id="VideoPlayback" type="application/x-shockwave-flash" src="http://video.google.com/googleplayer.swf?docId=123456&hl=en" flashvars=""> </embed> <embed src="http://blip.tv/play/gaUIx5A7AA" type="application/x-shockwave-flash" width="320" height="270" allowscriptaccess="always" allowfullscreen="true"></embed> <iframe width="575" height="324" src="http://cache.vevo.com/m/html/embed.html?video=GBA320903400&autoplay=1" frameborder="0" allowfullscreen></iframe> https://www.facebook.com/FacebookDevelopers/posts/10151471074398553 https://www.facebook.com/video/embed?video_id=10152778880075249 "https://www.facebook.com/FacebookDevelopers/videos/10152454700553553/" <div class="post_source_linkbar"> <img class="post_source_logo" src="http://economyincrisis.org/wp-content/uploads/2011/08/EICtext5.png"><img class="post_source_icon" title="Economy In Crisis" src="http://www.google.com/s2/favicons?domain=http%3A%2F%2Feconomyincrisis.org%2F">Source</div>'; function media_add($a) { global $_media_list; $_media_list[] = $a[0]; return ''; } function embedded_media($content) { global $_media_list; $_media_list = array(); preg_replace_callback(array( '/(https?:|)\/\/(?:[0-9A-Z-]+\.)?(?:youtu\.be\/|youtube\.com(?:\/embed\/|\/v\/|\/watch\?v=|\/ytscreeningroom\?v=|\/feeds\/api\/videos\/|\/user\S*[^\w\-\s]|\S*[^\w\-\s]))([\w\-]{11})[?=&+%\w-]*/i', '/(https?:|)\/\/vimeo\.com\/(\d+)/i', '/(https?:|)\/\/www\.metacafe\.com\/watch\/(\d+)\/(\w+)/i', '/(https?:|)\/\/www\.dailymotion\.com[^\/]*\/video\/(\w+)/i', '/(https?:|)\/\/blip.tv\/play\/(\w+)/i', '/(https?:|)\/\/(?:[0-9A-Z-]+\.)?vevo\.com[^\?]+\?video\=(\w+)/i', '/(https?:|)\/\/www\.facebook\.com\/([^\?]+\?video_id\=\w+|[^\/]*\/videos\/\w+)/i', ), 'media_add', $content); return $_media_list; } var_dump(embedded_media($_content));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/b9d64
function name:  (null)
number of ops:  8
compiled vars:  !0 = $_content
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%3Cp+class%3D%22post_content%22%3E%5Biframe+width%3D%22256%22+height%3D%22175%22+src%3D%22http%3A%2F%2Fwww.youtube.com%2Fembed%2FICx3AfSlc-w%22+frameborder%3D%220%22+allowfullscreen%5D%3C%2Fp%3E%0A++++%2F%2Fwww.youtu.be%2Fasdlfkjad_1%0A++++https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DdZpc936_Hgo%0A++++http%3A%2F%2Fyoutu.be%2FlvOFck4dn_8%0A++++http%3A%2F%2Fvimeo.com%2F65484727%0A++++http%3A%2F%2Fwww.metacafe.com%2Fwatch%2F10599819%2Fare_katy_perry_and_john_mayer_back_together%0A++++http%3A%2F%2Fwww.dailymotion.com%2Fvideo%2Fxzdijh_hire-data-entry-expert_news%0A++++%3Cembed+style%3D%22width%3A400px%3B+height%3A326px%3B%22+wmode%3D%22opaque%22+id%3D%22VideoPlayback%22+type%3D%22application%2Fx-shockwave-flash%22+src%3D%22http%3A%2F%2Fvideo.google.com%2Fgoogleplayer.swf%3FdocId%3D123456%26hl%3Den%22+flashvars%3D%22%22%3E+%3C%2Fembed%3E%0A++++%3Cembed+src%3D%22http%3A%2F%2Fblip.tv%2Fplay%2FgaUIx5A7AA%22+type%3D%22application%2Fx-shockwave-flash%22+width%3D%22320%22+height%3D%22270%22+allowscriptaccess%3D%22always%22+allowfullscreen%3D%22true%22%3E%3C%2Fembed%3E%0A++++%3Ciframe+width%3D%22575%22+height%3D%22324%22+src%3D%22http%3A%2F%2Fcache.vevo.com%2Fm%2Fhtml%2Fembed.html%3Fvideo%3DGBA320903400%26autoplay%3D1%22+frameborder%3D%220%22+allowfullscreen%3E%3C%2Fiframe%3E%0A++++https%3A%2F%2Fwww.facebook.com%2FFacebookDevelopers%2Fposts%2F10151471074398553%0A++++https%3A%2F%2Fwww.facebook.com%2Fvideo%2Fembed%3Fvideo_id%3D10152778880075249%0A++++%22https%3A%2F%2Fwww.facebook.com%2FFacebookDevelopers%2Fvideos%2F10152454700553553%2F%22%0A%3Cdiv+class%3D%22post_source_linkbar%22%3E%0A%3Cimg+class%3D%22post_source_logo%22+src%3D%22http%3A%2F%2Feconomyincrisis.org%2Fwp-content%2Fuploads%2F2011%2F08%2FEICtext5.png%22%3E%3Cimg+class%3D%22post_source_icon%22+title%3D%22Economy+In+Crisis%22+src%3D%22http%3A%2F%2Fwww.google.com%2Fs2%2Ffavicons%3Fdomain%3Dhttp%253A%252F%252Feconomyincrisis.org%252F%22%3ESource%3C%2Fdiv%3E'
   34     1        INIT_FCALL                                               'var_dump'
          2        INIT_FCALL                                               'embedded_media'
          3        SEND_VAR                                                 !0
          4        DO_FCALL                                      0  $2      
          5        SEND_VAR                                                 $2
          6        DO_ICALL                                                 
          7      > RETURN                                                   1

Function media_add:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/b9d64
function name:  media_add
number of ops:  7
compiled vars:  !0 = $a, !1 = $_media_list
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   RECV                                             !0      
   19     1        BIND_GLOBAL                                              !1, '_media_list'
          2        FETCH_DIM_R                                      ~3      !0, 0
          3        ASSIGN_DIM                                               !1
          4        OP_DATA                                                  ~3
          5      > RETURN                                                   ''
   20     6*     > RETURN                                                   null

End of function media_add

Function embedded_media:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/b9d64
function name:  embedded_media
number of ops:  10
compiled vars:  !0 = $content, !1 = $_media_list
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   RECV                                             !0      
   22     1        BIND_GLOBAL                                              !1, '_media_list'
          2        ASSIGN                                                   !1, <array>
          3        INIT_FCALL                                               'preg_replace_callback'
   23     4        SEND_VAL                                                 <array>
   30     5        SEND_VAL                                                 'media_add'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                                 
   31     8      > RETURN                                                   !1
   32     9*     > RETURN                                                   null

End of function embedded_media

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.9 ms | 1403 KiB | 18 Q