3v4l.org

run code in 300+ PHP versions simultaneously
<?php $body = '<blockquote class="instagram-media" data-instgrm-version="7" style=" background:#FFF; border:0; border-radius:3px; box-shadow:0 0 1px 0 rgba(0,0,0,0.5),0 1px 10px 0 rgba(0,0,0,0.15); margin: 1px; max-width:658px; padding:0; width:99.375%; width:-webkit-calc(100% - 2px); width:calc(100% - 2px);"> <div style="padding:8px;"> <div style=" background:#F8F8F8; line-height:0; margin-top:40px; padding:50.0% 0; text-align:center; width:100%;"> <div style=" background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAAAsCAMAAAApWqozAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAMUExURczMzPf399fX1+bm5mzY9AMAAADiSURBVDjLvZXbEsMgCES5/P8/t9FuRVCRmU73JWlzosgSIIZURCjo/ad+EQJJB4Hv8BFt+IDpQoCx1wjOSBFhh2XssxEIYn3ulI/6MNReE07UIWJEv8UEOWDS88LY97kqyTliJKKtuYBbruAyVh5wOHiXmpi5we58Ek028czwyuQdLKPG1Bkb4NnM+VeAnfHqn1k4+GPT6uGQcvu2h2OVuIf/gWUFyy8OWEpdyZSa3aVCqpVoVvzZZ2VTnn2wU8qzVjDDetO90GSy9mVLqtgYSy231MxrY6I2gGqjrTY0L8fxCxfCBbhWrsYYAAAAAElFTkSuQmCC); display:block; height:44px; margin:0 auto -44px; position:relative; top:-22px; width:44px;"></div> </div> <a href="https://www.instagram.com/p/BWOJZQxleIF/" style=" color:#c9c8cd; font-family:Arial,sans-serif; font-size:14px; font-style:normal; font-weight:normal; line-height:17px; text-decoration:none;" target="_blank">Ryo Miyaichi Official 宮市亮さん(@ryo381)がシェアした投稿</a> - <time style=" font-family:Arial,sans-serif; font-size:14px; line-height:17px;" datetime="2017-07-06T21:58:23+00:00">2017 7月 6 2:58午後 PDT</time> <br /> </div> </blockquote> <script async="" defer="" src="//platform.instagram.com/en_US/embeds.js"></script>'; $body = preg_replace_callback('!(https://twitter.com/[^/]+?/status/\d+)!s', function ($matches) { return '[[embed-twitter]](' . trim($matches[1]) . ')'; }, $body); $body = preg_replace_callback('!(<blockquote class="twitter-tweet" align="center">.*?\(\[\[embed-twitter\]\]\((https://twitter.com/[^/]+?/status/\d+)\)\)</blockquote>)!s', function ($matches) { return '[[embed-twitter]](' . trim($matches[2]) . ')'; }, $body); $body = preg_replace_callback('!(<blockquote class="twitter-.*?(\[\[embed-twitter\]\]\(https://twitter.com/[^/]+?/status/\d+\)).+?</blockquote>.+?twitter.com.+?</script>)!s', function ($matches) { return trim($matches[2]); }, $body); // InstagramのURLをembedに変換 $body = preg_replace_callback('!(https://www.instagram.com/p/[^/]+?/[\?a-zA-Z0-9_\-=]*)!s', function ($matches) { return '[[embed-instagram]](' . trim($matches[1]) . ')'; }, $body); $body = preg_replace_callback('!(<blockquote class="instagram-.*?(\[\[embed-instagram\]\]\(https://www.instagram.com/p/[^/]+?/[\?a-zA-Z0-9_\-=]*\)).+?</blockquote>.+?instagram.com.+?</script>)!s', function ($matches) { return trim($matches[2]); }, $body); echo $body; ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qrMD6
function name:  (null)
number of ops:  38
compiled vars:  !0 = $body
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%3Cblockquote+class%3D%22instagram-media%22+data-instgrm-version%3D%227%22+style%3D%22+background%3A%23FFF%3B+border%3A0%3B+border-radius%3A3px%3B+box-shadow%3A0+0+1px+0+rgba%280%2C0%2C0%2C0.5%29%2C0+1px+10px+0+rgba%280%2C0%2C0%2C0.15%29%3B+margin%3A+1px%3B+max-width%3A658px%3B+padding%3A0%3B+width%3A99.375%25%3B+width%3A-webkit-calc%28100%25+-+2px%29%3B+width%3Acalc%28100%25+-+2px%29%3B%22%3E%0A+%3Cdiv+style%3D%22padding%3A8px%3B%22%3E+%0A++%3Cdiv+style%3D%22+background%3A%23F8F8F8%3B+line-height%3A0%3B+margin-top%3A40px%3B+padding%3A50.0%25+0%3B+text-align%3Acenter%3B+width%3A100%25%3B%22%3E+%0A+++%3Cdiv+style%3D%22+background%3Aurl%28data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAACwAAAAsCAMAAAApWqozAAAABGdBTUEAALGPC%2FxhBQAAAAFzUkdCAK7OHOkAAAAMUExURczMzPf399fX1%2Bbm5mzY9AMAAADiSURBVDjLvZXbEsMgCES5%2FP8%2Ft9FuRVCRmU73JWlzosgSIIZURCjo%2Fad%2BEQJJB4Hv8BFt%2BIDpQoCx1wjOSBFhh2XssxEIYn3ulI%2F6MNReE07UIWJEv8UEOWDS88LY97kqyTliJKKtuYBbruAyVh5wOHiXmpi5we58Ek028czwyuQdLKPG1Bkb4NnM%2BVeAnfHqn1k4%2BGPT6uGQcvu2h2OVuIf%2FgWUFyy8OWEpdyZSa3aVCqpVoVvzZZ2VTnn2wU8qzVjDDetO90GSy9mVLqtgYSy231MxrY6I2gGqjrTY0L8fxCxfCBbhWrsYYAAAAAElFTkSuQmCC%29%3B+display%3Ablock%3B+height%3A44px%3B+margin%3A0+auto+-44px%3B+position%3Arelative%3B+top%3A-22px%3B+width%3A44px%3B%22%3E%3C%2Fdiv%3E%0A++%3C%2Fdiv%3E%0A++%3Ca+href%3D%22https%3A%2F%2Fwww.instagram.com%2Fp%2FBWOJZQxleIF%2F%22+style%3D%22+color%3A%23c9c8cd%3B+font-family%3AArial%2Csans-serif%3B+font-size%3A14px%3B+font-style%3Anormal%3B+font-weight%3Anormal%3B+line-height%3A17px%3B+text-decoration%3Anone%3B%22+target%3D%22_blank%22%3ERyo+Miyaichi+Official+%E5%AE%AE%E5%B8%82%E4%BA%AE%E3%81%95%E3%82%93%28%40ryo381%29%E3%81%8C%E3%82%B7%E3%82%A7%E3%82%A2%E3%81%97%E3%81%9F%E6%8A%95%E7%A8%BF%3C%2Fa%3E+-+%0A++%3Ctime+style%3D%22+font-family%3AArial%2Csans-serif%3B+font-size%3A14px%3B+line-height%3A17px%3B%22+datetime%3D%222017-07-06T21%3A58%3A23%2B00%3A00%22%3E2017+7%E6%9C%88+6+2%3A58%E5%8D%88%E5%BE%8C+PDT%3C%2Ftime%3E%0A++%3Cbr+%2F%3E%0A+%3C%2Fdiv%3E%0A%3C%2Fblockquote%3E+%0A%3Cscript+async%3D%22%22+defer%3D%22%22+src%3D%22%2F%2Fplatform.instagram.com%2Fen_US%2Fembeds.js%22%3E%3C%2Fscript%3E'
   14     1        INIT_FCALL                                               'preg_replace_callback'
          2        SEND_VAL                                                 '%21%28https%3A%2F%2Ftwitter.com%2F%5B%5E%2F%5D%2B%3F%2Fstatus%2F%5Cd%2B%29%21s'
          3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FqrMD6%3A14%240'
   16     4        SEND_VAL                                                 ~2
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $3      
   14     7        ASSIGN                                                   !0, $3
   17     8        INIT_FCALL                                               'preg_replace_callback'
          9        SEND_VAL                                                 '%21%28%3Cblockquote+class%3D%22twitter-tweet%22+align%3D%22center%22%3E.%2A%3F%5C%28%5C%5B%5C%5Bembed-twitter%5C%5D%5C%5D%5C%28%28https%3A%2F%2Ftwitter.com%2F%5B%5E%2F%5D%2B%3F%2Fstatus%2F%5Cd%2B%29%5C%29%5C%29%3C%2Fblockquote%3E%29%21s'
         10        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FqrMD6%3A17%241'
   19    11        SEND_VAL                                                 ~5
         12        SEND_VAR                                                 !0
         13        DO_ICALL                                         $6      
   17    14        ASSIGN                                                   !0, $6
   21    15        INIT_FCALL                                               'preg_replace_callback'
         16        SEND_VAL                                                 '%21%28%3Cblockquote+class%3D%22twitter-.%2A%3F%28%5C%5B%5C%5Bembed-twitter%5C%5D%5C%5D%5C%28https%3A%2F%2Ftwitter.com%2F%5B%5E%2F%5D%2B%3F%2Fstatus%2F%5Cd%2B%5C%29%29.%2B%3F%3C%2Fblockquote%3E.%2B%3Ftwitter.com.%2B%3F%3C%2Fscript%3E%29%21s'
         17        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FqrMD6%3A21%242'
   23    18        SEND_VAL                                                 ~8
         19        SEND_VAR                                                 !0
         20        DO_ICALL                                         $9      
   21    21        ASSIGN                                                   !0, $9
   26    22        INIT_FCALL                                               'preg_replace_callback'
         23        SEND_VAL                                                 '%21%28https%3A%2F%2Fwww.instagram.com%2Fp%2F%5B%5E%2F%5D%2B%3F%2F%5B%5C%3Fa-zA-Z0-9_%5C-%3D%5D%2A%29%21s'
         24        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FqrMD6%3A26%243'
   28    25        SEND_VAL                                                 ~11
         26        SEND_VAR                                                 !0
         27        DO_ICALL                                         $12     
   26    28        ASSIGN                                                   !0, $12
   30    29        INIT_FCALL                                               'preg_replace_callback'
         30        SEND_VAL                                                 '%21%28%3Cblockquote+class%3D%22instagram-.%2A%3F%28%5C%5B%5C%5Bembed-instagram%5C%5D%5C%5D%5C%28https%3A%2F%2Fwww.instagram.com%2Fp%2F%5B%5E%2F%5D%2B%3F%2F%5B%5C%3Fa-zA-Z0-9_%5C-%3D%5D%2A%5C%29%29.%2B%3F%3C%2Fblockquote%3E.%2B%3Finstagram.com.%2B%3F%3C%2Fscript%3E%29%21s'
         31        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FqrMD6%3A30%244'
   32    32        SEND_VAL                                                 ~14
         33        SEND_VAR                                                 !0
         34        DO_ICALL                                         $15     
   30    35        ASSIGN                                                   !0, $15
   34    36        ECHO                                                     !0
   36    37      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FqrMD6%3A14%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qrMD6
function name:  {closure}
number of ops:  9
compiled vars:  !0 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
   15     1        INIT_FCALL                                               'trim'
          2        FETCH_DIM_R                                      ~1      !0, 1
          3        SEND_VAL                                                 ~1
          4        DO_ICALL                                         $2      
          5        CONCAT                                           ~3      '%5B%5Bembed-twitter%5D%5D%28', $2
          6        CONCAT                                           ~4      ~3, '%29'
          7      > RETURN                                                   ~4
   16     8*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FqrMD6%3A14%240

Function %00%7Bclosure%7D%2Fin%2FqrMD6%3A17%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qrMD6
function name:  {closure}
number of ops:  9
compiled vars:  !0 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
   18     1        INIT_FCALL                                               'trim'
          2        FETCH_DIM_R                                      ~1      !0, 2
          3        SEND_VAL                                                 ~1
          4        DO_ICALL                                         $2      
          5        CONCAT                                           ~3      '%5B%5Bembed-twitter%5D%5D%28', $2
          6        CONCAT                                           ~4      ~3, '%29'
          7      > RETURN                                                   ~4
   19     8*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FqrMD6%3A17%241

Function %00%7Bclosure%7D%2Fin%2FqrMD6%3A21%242:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qrMD6
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   RECV                                             !0      
   22     1        INIT_FCALL                                               'trim'
          2        FETCH_DIM_R                                      ~1      !0, 2
          3        SEND_VAL                                                 ~1
          4        DO_ICALL                                         $2      
          5      > RETURN                                                   $2
   23     6*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FqrMD6%3A21%242

Function %00%7Bclosure%7D%2Fin%2FqrMD6%3A26%243:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qrMD6
function name:  {closure}
number of ops:  9
compiled vars:  !0 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   RECV                                             !0      
   27     1        INIT_FCALL                                               'trim'
          2        FETCH_DIM_R                                      ~1      !0, 1
          3        SEND_VAL                                                 ~1
          4        DO_ICALL                                         $2      
          5        CONCAT                                           ~3      '%5B%5Bembed-instagram%5D%5D%28', $2
          6        CONCAT                                           ~4      ~3, '%29'
          7      > RETURN                                                   ~4
   28     8*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FqrMD6%3A26%243

Function %00%7Bclosure%7D%2Fin%2FqrMD6%3A30%244:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qrMD6
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   30     0  E >   RECV                                             !0      
   31     1        INIT_FCALL                                               'trim'
          2        FETCH_DIM_R                                      ~1      !0, 2
          3        SEND_VAL                                                 ~1
          4        DO_ICALL                                         $2      
          5      > RETURN                                                   $2
   32     6*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FqrMD6%3A30%244

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
179.88 ms | 1408 KiB | 17 Q