3v4l.org

run code in 300+ PHP versions simultaneously
<?php $_GET['yk'] = 'aabb'; $get = '_GET'; $tmp = $$get; echo $tmp['yk']; //right class yk{ public function get(){ $get = '_GET'; $tmp = ${'_GET'}; echo $tmp['yk']; } public function get2(){ $get = 'Atmp'; $Atmp = 'bbaa'; $tmp = $$get; echo $tmp; } } $yk = new yk(); $yk->get(); //error Undefined variable: _GET
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/E57sW
function name:  (null)
number of ops:  14
compiled vars:  !0 = $get, !1 = $tmp, !2 = $yk
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   FETCH_W                      global              $3      '_GET'
          1        ASSIGN_DIM                                               $3, 'yk'
          2        OP_DATA                                                  'aabb'
    4     3        ASSIGN                                                   !0, '_GET'
    5     4        FETCH_R                      local               ~6      !0
          5        ASSIGN                                                   !1, ~6
    6     6        FETCH_DIM_R                                      ~8      !1, 'yk'
          7        ECHO                                                     ~8
   24     8        NEW                                              $9      'yk'
          9        DO_FCALL                                      0          
         10        ASSIGN                                                   !2, $9
   25    11        INIT_METHOD_CALL                                         !2, 'get'
         12        DO_FCALL                                      0          
         13      > RETURN                                                   1

Class yk:
Function get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/E57sW
function name:  get
number of ops:  6
compiled vars:  !0 = $get, !1 = $tmp
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   ASSIGN                                                   !0, '_GET'
   12     1        FETCH_R                      global              ~3      '_GET'
          2        ASSIGN                                                   !1, ~3
   13     3        FETCH_DIM_R                                      ~5      !1, 'yk'
          4        ECHO                                                     ~5
   14     5      > RETURN                                                   null

End of function get

Function get2:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/E57sW
function name:  get2
number of ops:  6
compiled vars:  !0 = $get, !1 = $Atmp, !2 = $tmp
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   ASSIGN                                                   !0, 'Atmp'
   18     1        ASSIGN                                                   !1, 'bbaa'
   19     2        FETCH_R                      local               ~5      !0
          3        ASSIGN                                                   !2, ~5
   20     4        ECHO                                                     !2
   21     5      > RETURN                                                   null

End of function get2

End of class yk.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.42 ms | 1395 KiB | 13 Q