3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = "abcdefgh"; $ass_arr = array(); $ass_arr["foo"] = "bar"; $str = preg_replace_callback("/[aeiou]/", function($matches){ global $ass_arr; $ass_arr["bar"] = "baz"; return "x"; }, $str); var_dump($str); var_dump($ass_arr);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/t1QE4
function name:  (null)
number of ops:  18
compiled vars:  !0 = $str, !1 = $ass_arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'abcdefgh'
    3     1        ASSIGN                                                   !1, <array>
    4     2        ASSIGN_DIM                                               !1, 'foo'
          3        OP_DATA                                                  'bar'
    6     4        INIT_FCALL                                               'preg_replace_callback'
          5        SEND_VAL                                                 '%2F%5Baeiou%5D%2F'
          6        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Ft1QE4%3A6%240'
   10     7        SEND_VAL                                                 ~5
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                         $6      
    6    10        ASSIGN                                                   !0, $6
   12    11        INIT_FCALL                                               'var_dump'
         12        SEND_VAR                                                 !0
         13        DO_ICALL                                                 
   13    14        INIT_FCALL                                               'var_dump'
         15        SEND_VAR                                                 !1
         16        DO_ICALL                                                 
         17      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2Ft1QE4%3A6%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/t1QE4
function name:  {closure}
number of ops:  6
compiled vars:  !0 = $matches, !1 = $ass_arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    7     1        BIND_GLOBAL                                              !1, 'ass_arr'
    8     2        ASSIGN_DIM                                               !1, 'bar'
          3        OP_DATA                                                  'baz'
    9     4      > RETURN                                                   'x'
   10     5*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2Ft1QE4%3A6%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.24 ms | 1395 KiB | 17 Q