3v4l.org

run code in 300+ PHP versions simultaneously
<?php $x = 4; if($x == 1){ class X{} session_start(); $_SESSION["x"] = new X(); $_SESSION["y"] = "5"; echo session_encode(); // x|O:1:"X":0:{}y|s:1:"5"; } elseif($x == 2){ session_start(); session_decode('x|O:1:"X":0:{}y|s:1:"5";'); $_SESSION["y"] = 6; echo session_encode(); die(); print_r($_SESSION); /* Array ( [x] => __PHP_Incomplete_Class Object ( [__PHP_Incomplete_Class_Name] => X ) [y] => 5 ) */ } elseif($x == 3){ enum Y{ case Y; } session_start(); $_SESSION["x"] = Y::Y; $_SESSION["y"] = "5"; echo session_encode(); // x|E:3:"Y:Y";y|s:1:"5"; } elseif($x == 4){ session_start(); session_decode('x|E:3:"Y:Y";y|s:1:"5";'); print_r($_SESSION); /* Warning: session_decode(): Class 'Y' not found in /in/1IEIF on line 36 Warning: session_decode(): Failed to decode session object. Session has been destroyed in /in/1IEIF on line 36 Array ( ) */ }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 18
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 64
Branch analysis from position: 64
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 37
Branch analysis from position: 20
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 37
2 jumps found. (Code = 43) Position 1 = 39, Position 2 = 53
Branch analysis from position: 39
1 jumps found. (Code = 42) Position 1 = 64
Branch analysis from position: 64
Branch analysis from position: 53
2 jumps found. (Code = 43) Position 1 = 55, Position 2 = 64
Branch analysis from position: 55
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 64
filename:       /in/mLGPa
function name:  (null)
number of ops:  65
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 4
    3     1        IS_EQUAL                                                 !0, 1
          2      > JMPZ                                                     ~2, ->18
    4     3    >   DECLARE_CLASS                                            'x'
    5     4        INIT_FCALL                                               'session_start'
          5        DO_ICALL                                                 
    6     6        NEW                                              $6      'X'
          7        DO_FCALL                                      0          
          8        FETCH_W                      global              $4      '_SESSION'
          9        ASSIGN_DIM                                               $4, 'x'
         10        OP_DATA                                                  $6
    7    11        FETCH_W                      global              $8      '_SESSION'
         12        ASSIGN_DIM                                               $8, 'y'
         13        OP_DATA                                                  '5'
    8    14        INIT_FCALL                                               'session_encode'
         15        DO_ICALL                                         $10     
         16        ECHO                                                     $10
    3    17      > JMP                                                      ->64
   10    18    >   IS_EQUAL                                                 !0, 2
         19      > JMPZ                                                     ~11, ->37
   11    20    >   INIT_FCALL                                               'session_start'
         21        DO_ICALL                                                 
   12    22        INIT_FCALL                                               'session_decode'
         23        SEND_VAL                                                 'x%7CO%3A1%3A%22X%22%3A0%3A%7B%7Dy%7Cs%3A1%3A%225%22%3B'
         24        DO_ICALL                                                 
   13    25        FETCH_W                      global              $14     '_SESSION'
         26        ASSIGN_DIM                                               $14, 'y'
         27        OP_DATA                                                  6
   14    28        INIT_FCALL                                               'session_encode'
         29        DO_ICALL                                         $16     
         30        ECHO                                                     $16
   15    31      > EXIT                                                     
   16    32*       INIT_FCALL                                               'print_r'
         33*       FETCH_R                      global              ~17     '_SESSION'
         34*       SEND_VAL                                                 ~17
         35*       DO_ICALL                                                 
   10    36*       JMP                                                      ->64
   28    37    >   IS_EQUAL                                                 !0, 3
         38      > JMPZ                                                     ~19, ->53
   29    39    >   DECLARE_CLASS                                            'y'
   32    40        INIT_FCALL                                               'session_start'
         41        DO_ICALL                                                 
   33    42        FETCH_CLASS_CONSTANT                             ~23     'Y', 'Y'
         43        FETCH_W                      global              $21     '_SESSION'
         44        ASSIGN_DIM                                               $21, 'x'
         45        OP_DATA                                                  ~23
   34    46        FETCH_W                      global              $24     '_SESSION'
         47        ASSIGN_DIM                                               $24, 'y'
         48        OP_DATA                                                  '5'
   35    49        INIT_FCALL                                               'session_encode'
         50        DO_ICALL                                         $26     
         51        ECHO                                                     $26
   28    52      > JMP                                                      ->64
   37    53    >   IS_EQUAL                                                 !0, 4
         54      > JMPZ                                                     ~27, ->64
   38    55    >   INIT_FCALL                                               'session_start'
         56        DO_ICALL                                                 
   39    57        INIT_FCALL                                               'session_decode'
         58        SEND_VAL                                                 'x%7CE%3A3%3A%22Y%3AY%22%3By%7Cs%3A1%3A%225%22%3B'
         59        DO_ICALL                                                 
   40    60        INIT_FCALL                                               'print_r'
         61        FETCH_R                      global              ~30     '_SESSION'
         62        SEND_VAL                                                 ~30
         63        DO_ICALL                                                 
   49    64    > > RETURN                                                   1

Class X: [no user functions]
Class Y: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
137.18 ms | 1006 KiB | 17 Q