3v4l.org

run code in 300+ PHP versions simultaneously
<?php $aa = 'str2'; function def_vars(){ $a = 'str'; $b = 2; return _R('return value',get_defined_vars()); } function _R($return,$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/ldHrL
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'
   14     1        INIT_FCALL                                               'def_vars'
          2        DO_FCALL                                      0  $2      
          3        ECHO                                                     $2
   15     4      > RETURN                                                   1

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

End of function _r

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.84 ms | 1402 KiB | 18 Q