3v4l.org

run code in 300+ PHP versions simultaneously
<?php $body = '<blockquote class="twitter-tweet" data-lang="ja"><p lang="en" dir="ltr">Thank you ! ~ that is all :) <a href="https://t.co/4evflUT84g">pic.twitter.com/4evflUT84g</a></p>— Chicago Police (@Chicago_Police) <a href="https://twitter.com/Chicago_Police/status/877727536125419520">2017年6月22日</a></blockquote><script async="" src="//platform.twitter.com/widgets.js" charset="utf-8"></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" data-lang="ja">.*?</blockquote>)!s', function ($matches) { return '[[embed-twitter]](' . trim($matches[2]) . ')'; }, $body); echo $body; ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FM1Pf
function name:  (null)
number of ops:  17
compiled vars:  !0 = $body
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%3Cblockquote+class%3D%22twitter-tweet%22+data-lang%3D%22ja%22%3E%3Cp+lang%3D%22en%22+dir%3D%22ltr%22%3EThank+you+%21+%7E+that+is+all+%3A%29+%3Ca+href%3D%22https%3A%2F%2Ft.co%2F4evflUT84g%22%3Epic.twitter.com%2F4evflUT84g%3C%2Fa%3E%3C%2Fp%3E%E2%80%94+Chicago+Police+%28%40Chicago_Police%29+%3Ca+href%3D%22https%3A%2F%2Ftwitter.com%2FChicago_Police%2Fstatus%2F877727536125419520%22%3E2017%E5%B9%B46%E6%9C%8822%E6%97%A5%3C%2Fa%3E%3C%2Fblockquote%3E%3Cscript+async%3D%22%22+src%3D%22%2F%2Fplatform.twitter.com%2Fwidgets.js%22+charset%3D%22utf-8%22%3E%3C%2Fscript%3E'
    4     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%2FFM1Pf%3A4%240'
    6     4        SEND_VAL                                                 ~2
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $3      
    4     7        ASSIGN                                                   !0, $3
    8     8        INIT_FCALL                                               'preg_replace_callback'
          9        SEND_VAL                                                 '%21%28%3Cblockquote+class%3D%22twitter-tweet%22+data-lang%3D%22ja%22%3E.%2A%3F%3C%2Fblockquote%3E%29%21s'
         10        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FFM1Pf%3A8%241'
   10    11        SEND_VAL                                                 ~5
         12        SEND_VAR                                                 !0
         13        DO_ICALL                                         $6      
    8    14        ASSIGN                                                   !0, $6
   12    15        ECHO                                                     !0
   14    16      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FFM1Pf%3A4%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FM1Pf
function name:  {closure}
number of ops:  9
compiled vars:  !0 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    5     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
    6     8*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FFM1Pf%3A4%240

Function %00%7Bclosure%7D%2Fin%2FFM1Pf%3A8%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FM1Pf
function name:  {closure}
number of ops:  9
compiled vars:  !0 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
    9     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
   10     8*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FFM1Pf%3A8%241

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.39 ms | 1400 KiB | 17 Q