3v4l.org

run code in 300+ PHP versions simultaneously
<?php function f() { $arr = ['u' => 'U']; $x = 'x'; $y = 'y'; $result = (fn () => [$x, $x = 'xx', $x, $y, $arr, $arr['w'] = 'W', $arr, $newvar = 'newvar'])(); var_export(get_defined_vars()); } f();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mdJvM
function name:  (null)
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   INIT_FCALL                                               'f'
          1        DO_FCALL                                      0          
          2      > RETURN                                                   1

Function f:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mdJvM
function name:  f
number of ops:  17
compiled vars:  !0 = $arr, !1 = $x, !2 = $y, !3 = $result, !4 = $newvar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, <array>
    5     1        ASSIGN                                                   !1, 'x'
    6     2        ASSIGN                                                   !2, 'y'
    7     3        DECLARE_LAMBDA_FUNCTION                          ~8      [0]
          4        BIND_LEXICAL                                             ~8, !1
          5        BIND_LEXICAL                                             ~8, !2
          6        BIND_LEXICAL                                             ~8, !0
          7        BIND_LEXICAL                                             ~8, !4
          8        INIT_DYNAMIC_CALL                                        ~8
          9        DO_FCALL                                      0  $9      
         10        ASSIGN                                                   !3, $9
    8    11        INIT_FCALL                                               'var_export'
         12        INIT_FCALL                                               'get_defined_vars'
         13        DO_ICALL                                         $11     
         14        SEND_VAR                                                 $11
         15        DO_ICALL                                                 
    9    16      > RETURN                                                   null


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mdJvM
function name:  {closure}
number of ops:  18
compiled vars:  !0 = $x, !1 = $y, !2 = $arr, !3 = $newvar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   BIND_STATIC                                              !0
          1        BIND_STATIC                                              !1
          2        BIND_STATIC                                              !2
          3        BIND_STATIC                                              !3
          4        INIT_ARRAY                                       ~4      !0
          5        ASSIGN                                           ~5      !0, 'xx'
          6        ADD_ARRAY_ELEMENT                                ~4      ~5
          7        ADD_ARRAY_ELEMENT                                ~4      !0
          8        ADD_ARRAY_ELEMENT                                ~4      !1
          9        ADD_ARRAY_ELEMENT                                ~4      !2
         10        ASSIGN_DIM                                       ~6      !2, 'w'
         11        OP_DATA                                                  'W'
         12        ADD_ARRAY_ELEMENT                                ~4      ~6
         13        ADD_ARRAY_ELEMENT                                ~4      !2
         14        ASSIGN                                           ~7      !3, 'newvar'
         15        ADD_ARRAY_ELEMENT                                ~4      ~7
         16      > RETURN                                                   ~4
         17*     > RETURN                                                   null

End of Dynamic Function 0

End of function f

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
139.38 ms | 1006 KiB | 16 Q