3v4l.org

run code in 300+ PHP versions simultaneously
<?php $aa = 'str2'; function def_vars(){ $a = 'str'; $b = 2; return _R(array()); } function _R($return){ $vars = get_defined_vars(); var_dump($vars); return $return; } echo def_vars(); //var_dump(get_defined_vars());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dU7Gt
function name:  (null)
number of ops:  5
compiled vars:  !0 = $aa
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'str2'
   15     1        INIT_FCALL                                               'def_vars'
          2        DO_FCALL                                      0  $2      
          3        ECHO                                                     $2
   16     4      > RETURN                                                   1

Function def_vars:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dU7Gt
function name:  def_vars
number of ops:  7
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, 'str'
    5     1        ASSIGN                                                   !1, 2
    6     2        INIT_FCALL_BY_NAME                                       '_R'
          3        SEND_VAL_EX                                              <array>
          4        DO_FCALL                                      0  $4      
          5      > RETURN                                                   $4
    7     6*     > RETURN                                                   null

End of function def_vars

Function _r:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dU7Gt
function name:  _R
number of ops:  9
compiled vars:  !0 = $return, !1 = $vars
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
   10     1        INIT_FCALL                                               'get_defined_vars'
          2        DO_ICALL                                         $2      
          3        ASSIGN                                                   !1, $2
   11     4        INIT_FCALL                                               'var_dump'
          5        SEND_VAR                                                 !1
          6        DO_ICALL                                                 
   12     7      > RETURN                                                   !0
   13     8*     > RETURN                                                   null

End of function _r

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
201.63 ms | 1402 KiB | 18 Q