3v4l.org

run code in 300+ PHP versions simultaneously
<?php $pattern = '(src|href)\=(\\\'|")([^\\\'"]+)(\\\'|")'; $source = <<<SRC <a href="http://www.sape.ru">some text</a> <img src='logo.jpg' alt=''></a> SRC; $callback = function($matches) { var_dump($matches); return ''; }; preg_replace_callback($pattern, $callback, $source);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/76L9V
function name:  (null)
number of ops:  10
compiled vars:  !0 = $pattern, !1 = $source, !2 = $callback
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%28src%7Chref%29%5C%3D%28%5C%27%7C%22%29%28%5B%5E%5C%27%22%5D%2B%29%28%5C%27%7C%22%29'
    5     1        ASSIGN                                                   !1, '%0A%3Ca+href%3D%22http%3A%2F%2Fwww.sape.ru%22%3Esome+text%3C%2Fa%3E%0A%0A%3Cimg+src%3D%27logo.jpg%27+alt%3D%27%27%3E%3C%2Fa%3E%0A'
   14     2        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F76L9V%3A14%240'
          3        ASSIGN                                                   !2, ~5
   23     4        INIT_FCALL                                               'preg_replace_callback'
          5        SEND_VAR                                                 !0
          6        SEND_VAR                                                 !2
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                                 
          9      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2F76L9V%3A14%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/76L9V
function name:  {closure}
number of ops:  6
compiled vars:  !0 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
   16     1        INIT_FCALL                                               'var_dump'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
   17     4      > RETURN                                                   ''
   20     5*     > RETURN                                                   null

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.29 ms | 1395 KiB | 17 Q