3v4l.org

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

Class A: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.25 ms | 1396 KiB | 23 Q