3v4l.org

run code in 300+ PHP versions simultaneously
<?php $patternCallbacks = [ '~\[code](.*?)\[/code]~is' => function($m) { return '[code]' . base64_encode($m[1]) . '[/code]'; }, ]; echo preg_replace_callback_array( $patternCallbacks, 'This is my [code]script[/code] to display' );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kANk9
function name:  (null)
number of ops:  9
compiled vars:  !0 = $patternCallbacks
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   DECLARE_LAMBDA_FUNCTION                          ~1      [0]
    7     1        INIT_ARRAY                                       ~2      ~1, '%7E%5C%5Bcode%5D%28.%2A%3F%29%5C%5B%2Fcode%5D%7Eis'
    3     2        ASSIGN                                                   !0, ~2
   10     3        INIT_FCALL                                               'preg_replace_callback_array'
   11     4        SEND_VAR                                                 !0
   12     5        SEND_VAL                                                 'This+is+my+%5Bcode%5Dscript%5B%2Fcode%5D+to+display'
   10     6        DO_ICALL                                         $4      
   12     7        ECHO                                                     $4
   13     8      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kANk9
function name:  {closure}
number of ops:  9
compiled vars:  !0 = $m
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    6     1        INIT_FCALL                                               'base64_encode'
          2        FETCH_DIM_R                                      ~1      !0, 1
          3        SEND_VAL                                                 ~1
          4        DO_ICALL                                         $2      
          5        CONCAT                                           ~3      '%5Bcode%5D', $2
          6        CONCAT                                           ~4      ~3, '%5B%2Fcode%5D'
          7      > RETURN                                                   ~4
    7     8*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.31 ms | 1005 KiB | 15 Q