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'] = array(); setKey('1:2:3', 77);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7thKU
function name:  (null)
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   FETCH_W                      global              $0      '_SESSION'
          1        FETCH_DIM_W                                      $1      $0, 1
          2        ASSIGN_DIM                                               $1, 2
          3        OP_DATA                                                  <array>
   16     4        INIT_FCALL                                               'setkey'
          5        SEND_VAL                                                 '1%3A2%3A3'
          6        SEND_VAL                                                 77
          7        DO_FCALL                                      0          
          8      > RETURN                                                   1

Function setkey:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7thKU
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+%3D+'
         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:
164.26 ms | 1399 KiB | 20 Q