3v4l.org

run code in 300+ PHP versions simultaneously
<?php $description = '<img src="http://web1.cz/obrazek.jpg">'; $description = preg_replace_callback('#<img(.*)src="(.*)"(.*)>#i', function($matches) { return '<img'.$matches[1].'src="img/'.base64_encode($matches[2]).'"'.$matches[3].'>'; }, $description); echo $description;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CBiol
function name:  (null)
number of ops:  10
compiled vars:  !0 = $description
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%3Cimg+src%3D%22http%3A%2F%2Fweb1.cz%2Fobrazek.jpg%22%3E'
    4     1        INIT_FCALL                                               'preg_replace_callback'
          2        SEND_VAL                                                 '%23%3Cimg%28.%2A%29src%3D%22%28.%2A%29%22%28.%2A%29%3E%23i'
          3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FCBiol%3A4%240'
    6     4        SEND_VAL                                                 ~2
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $3      
    4     7        ASSIGN                                                   !0, $3
    8     8        ECHO                                                     !0
          9      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FCBiol%3A4%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CBiol
function name:  {closure}
number of ops:  15
compiled vars:  !0 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    5     1        FETCH_DIM_R                                      ~1      !0, 1
          2        CONCAT                                           ~2      '%3Cimg', ~1
          3        CONCAT                                           ~3      ~2, 'src%3D%22img%2F'
          4        INIT_FCALL                                               'base64_encode'
          5        FETCH_DIM_R                                      ~4      !0, 2
          6        SEND_VAL                                                 ~4
          7        DO_ICALL                                         $5      
          8        CONCAT                                           ~6      ~3, $5
          9        CONCAT                                           ~7      ~6, '%22'
         10        FETCH_DIM_R                                      ~8      !0, 3
         11        CONCAT                                           ~9      ~7, ~8
         12        CONCAT                                           ~10     ~9, '%3E'
         13      > RETURN                                                   ~10
    6    14*     > RETURN                                                   null

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.63 ms | 1396 KiB | 17 Q