3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getVarName(&$var) { $var = serialize($var); $name = array_search($var, $GLOBALS, true); $var = unserialize($var); return $name; } function foo(&$yoba) { echo getVarName($yoba); } $peka = true; foo($peka);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/e71Mm
function name:  (null)
number of ops:  5
compiled vars:  !0 = $peka
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   ASSIGN                                                   !0, <true>
   17     1        INIT_FCALL                                               'foo'
          2        SEND_REF                                                 !0
          3        DO_FCALL                                      0          
          4      > RETURN                                                   1

Function getvarname:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/e71Mm
function name:  getVarName
number of ops:  18
compiled vars:  !0 = $var, !1 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        INIT_FCALL                                               'serialize'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $2      
          4        ASSIGN                                                   !0, $2
    6     5        INIT_FCALL                                               'array_search'
          6        SEND_VAR                                                 !0
          7        FETCH_GLOBALS                                    ~4      
          8        SEND_VAL                                                 ~4
          9        SEND_VAL                                                 <true>
         10        DO_ICALL                                         $5      
         11        ASSIGN                                                   !1, $5
    7    12        INIT_FCALL                                               'unserialize'
         13        SEND_VAR                                                 !0
         14        DO_ICALL                                         $7      
         15        ASSIGN                                                   !0, $7
    9    16      > RETURN                                                   !1
   10    17*     > RETURN                                                   null

End of function getvarname

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/e71Mm
function name:  foo
number of ops:  6
compiled vars:  !0 = $yoba
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
   13     1        INIT_FCALL                                               'getvarname'
          2        SEND_REF                                                 !0
          3        DO_FCALL                                      0  $1      
          4        ECHO                                                     $1
   14     5      > RETURN                                                   null

End of function foo

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
139.01 ms | 1003 KiB | 18 Q