3v4l.org

run code in 300+ PHP versions simultaneously
<?php function media_add($a) { global $media_list; $media_list[] = $a[0]; return $a[0]; } $_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> <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>'; 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?:|)\/\/video.google.[A-Za-z\.]{2,5}\/[^\?]+\?docid\=[0-9\-]+/i', '/(https?:|)\/\/blip.tv\/play\/(\w+)/i' ), 'media_add', $_content); /* http://all4wp.blogspot.com/2008/03/regex-for-embed-video.html 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 */ var_dump($media_list);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LcbVs
function name:  (null)
number of ops:  10
compiled vars:  !0 = $_content, !1 = $media_list
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     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%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'
   18     1        INIT_FCALL                                               'preg_replace_callback'
   19     2        SEND_VAL                                                 <array>
   25     3        SEND_VAL                                                 'media_add'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                                 
   36     6        INIT_FCALL                                               'var_dump'
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                                 
          9      > RETURN                                                   1

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

End of function media_add

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
189.97 ms | 1396 KiB | 17 Q