3v4l.org

run code in 300+ PHP versions simultaneously
<?php session_start(); class A { public $var = 0; } if(isset($_SESSION['a_array'])) { $a = new A(); $_SESSION['a'] = $a; $a->var = rand(); array_push($_SESSION['a_array'], $a); } else { $a_array = Array(); $_SESSION['a_array'] = $a_array; } echo var_dump($_SESSION['a_array']);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 22
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XTvdr
function name:  (null)
number of ops:  33
compiled vars:  !0 = $a, !1 = $a_array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'session_start'
          1        DO_ICALL                                                 
   10     2        FETCH_IS                                         ~3      '_SESSION'
          3        ISSET_ISEMPTY_DIM_OBJ                         0          ~3, 'a_array'
          4      > JMPZ                                                     ~4, ->22
   13     5    >   NEW                                              $5      'A'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !0, $5
   14     8        FETCH_W                      global              $8      '_SESSION'
          9        ASSIGN_DIM                                               $8, 'a'
         10        OP_DATA                                                  !0
   15    11        INIT_FCALL                                               'rand'
         12        DO_ICALL                                         $11     
         13        ASSIGN_OBJ                                               !0, 'var'
         14        OP_DATA                                                  $11
   17    15        INIT_FCALL                                               'array_push'
         16        FETCH_W                      global              $12     '_SESSION'
         17        FETCH_DIM_W                                      $13     $12, 'a_array'
         18        SEND_REF                                                 $13
         19        SEND_VAR                                                 !0
         20        DO_ICALL                                                 
         21      > JMP                                                      ->26
   23    22    >   ASSIGN                                                   !1, <array>
   24    23        FETCH_W                      global              $16     '_SESSION'
         24        ASSIGN_DIM                                               $16, 'a_array'
         25        OP_DATA                                                  !1
   28    26    >   INIT_FCALL                                               'var_dump'
         27        FETCH_R                      global              ~18     '_SESSION'
         28        FETCH_DIM_R                                      ~19     ~18, 'a_array'
         29        SEND_VAL                                                 ~19
         30        DO_ICALL                                         $20     
         31        ECHO                                                     $20
         32      > RETURN                                                   1

Class A: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.04 ms | 1396 KiB | 21 Q