3v4l.org

run code in 300+ PHP versions simultaneously
<?php session_start(); function foo() { $t = '_SESSION'; $a = $$t; // not work $b = ${'_SESSION'}; // works var_dump($a, $b); } foo();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZZB0I
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'session_start'
          1        DO_ICALL                                                 
   11     2        INIT_FCALL                                               'foo'
          3        DO_FCALL                                      0          
          4      > RETURN                                                   1

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZZB0I
function name:  foo
number of ops:  10
compiled vars:  !0 = $t, !1 = $a, !2 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ASSIGN                                                   !0, '_SESSION'
    6     1        FETCH_R                      local               ~4      !0
          2        ASSIGN                                                   !1, ~4
    7     3        FETCH_R                      global              ~6      '_SESSION'
          4        ASSIGN                                                   !2, ~6
    8     5        INIT_FCALL                                               'var_dump'
          6        SEND_VAR                                                 !1
          7        SEND_VAR                                                 !2
          8        DO_ICALL                                                 
    9     9      > RETURN                                                   null

End of function foo

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.57 ms | 1397 KiB | 18 Q