3v4l.org

run code in 300+ PHP versions simultaneously
<?php function setKey($sessionKeys, $value) { $sessionKeysArray = explode(':', $sessionKeys); $sessionKey = ''; $keys = '[\'' . implode('\'][\'', $sessionKeysArray) . '\']'; eval('$tmp = is_array(&$_SESSION' . $sessionKey . ') ? ' . $value . ' : \'xxx\';'); var_dump($tmp); } $_SESSION['1']['2']['3'] = zzzz; setKey('1:2:3', 77);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ISKcr
function name:  (null)
number of ops:  11
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   FETCH_CONSTANT                                   ~4      'zzzz'
          1        FETCH_W                      global              $0      '_SESSION'
          2        FETCH_DIM_W                                      $1      $0, 1
          3        FETCH_DIM_W                                      $2      $1, 2
          4        ASSIGN_DIM                                               $2, 3
          5        OP_DATA                                                  ~4
   16     6        INIT_FCALL                                               'setkey'
          7        SEND_VAL                                                 '1%3A2%3A3'
          8        SEND_VAL                                                 77
          9        DO_FCALL                                      0          
         10      > RETURN                                                   1

Function setkey:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ISKcr
function name:  setKey
number of ops:  24
compiled vars:  !0 = $sessionKeys, !1 = $value, !2 = $sessionKeysArray, !3 = $sessionKey, !4 = $keys, !5 = $tmp
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    5     2        INIT_FCALL                                               'explode'
          3        SEND_VAL                                                 '%3A'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $6      
          6        ASSIGN                                                   !2, $6
    6     7        ASSIGN                                                   !3, ''
    7     8        INIT_FCALL                                               'implode'
          9        SEND_VAL                                                 '%27%5D%5B%27'
         10        SEND_VAR                                                 !2
         11        DO_ICALL                                         $9      
         12        CONCAT                                           ~10     '%5B%27', $9
         13        CONCAT                                           ~11     ~10, '%27%5D'
         14        ASSIGN                                                   !4, ~11
    9    15        CONCAT                                           ~13     '%24tmp+%3D+is_array%28%26%24_SESSION', !3
         16        CONCAT                                           ~14     ~13, '%29+%3F+'
         17        CONCAT                                           ~15     ~14, !1
         18        CONCAT                                           ~16     ~15, '+%3A+%27xxx%27%3B'
         19        INCLUDE_OR_EVAL                                          ~16, EVAL
   11    20        INIT_FCALL                                               'var_dump'
         21        SEND_VAR                                                 !5
         22        DO_ICALL                                                 
   14    23      > RETURN                                                   null

End of function setkey

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.51 ms | 1399 KiB | 20 Q