3v4l.org

run code in 500+ PHP versions simultaneously
<?php class test { protected $container; public function __construct() { } public function __get($name) { if ($name === 'container') { $a = new stdClass(); $a->test = random_bytes(7); return $a; } } public function __set($name, $value) { if ($name === 'container') { } } function blah() { $this->container = 'test'; } public function dump() { var_dump($this->container); } } $a =new test(); $a->dump(); $a->blah(); $a->dump(); var_dump($a->container);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6QiDh
function name:  (null)
number of ops:  14
compiled vars:  !0 = $a
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   33     0  E >   NEW                                                  $1      'test'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $1
   34     3        INIT_METHOD_CALL                                             !0, 'dump'
          4        DO_FCALL                                          0          
   36     5        INIT_METHOD_CALL                                             !0, 'blah'
          6        DO_FCALL                                          0          
   37     7        INIT_METHOD_CALL                                             !0, 'dump'
          8        DO_FCALL                                          0          
   40     9        INIT_FCALL                                                   'var_dump'
         10        FETCH_OBJ_R                                          ~7      !0, 'container'
         11        SEND_VAL                                                     ~7
         12        DO_ICALL                                                     
         13      > RETURN                                                       1

Class test:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6QiDh
function name:  __construct
number of ops:  1
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    8     0  E > > RETURN                                                       null

End of function __construct

Function __get:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 12
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6QiDh
function name:  __get
number of ops:  13
compiled vars:  !0 = $name, !1 = $a
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   10     0  E >   RECV                                                 !0      
   11     1        IS_IDENTICAL                                                 !0, 'container'
          2      > JMPZ                                                         ~2, ->12
   12     3    >   NEW                                                  $3      'stdClass'
          4        DO_FCALL                                          0          
          5        ASSIGN                                                       !1, $3
   13     6        INIT_FCALL                                                   'random_bytes'
          7        SEND_VAL                                                     7
          8        DO_ICALL                                             $7      
          9        ASSIGN_OBJ                                                   !1, 'test'
         10        OP_DATA                                                      $7
   14    11      > RETURN                                                       !1
   16    12    > > RETURN                                                       null

End of function __get

Function __set:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 4
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
filename:       /in/6QiDh
function name:  __set
number of ops:  5
compiled vars:  !0 = $name, !1 = $value
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   18     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
   19     2        IS_IDENTICAL                                                 !0, 'container'
          3      > JMPZ                                                         ~2, ->4
   21     4    > > RETURN                                                       null

End of function __set

Function blah:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6QiDh
function name:  blah
number of ops:  3
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   24     0  E >   ASSIGN_OBJ                                                   'container'
          1        OP_DATA                                                      'test'
   25     2      > RETURN                                                       null

End of function blah

Function dump:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6QiDh
function name:  dump
number of ops:  5
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   28     0  E >   INIT_FCALL                                                   'var_dump'
          1        FETCH_OBJ_R                                          ~0      'container'
          2        SEND_VAL                                                     ~0
          3        DO_ICALL                                                     
   29     4      > RETURN                                                       null

End of function dump

End of class test.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
146.61 ms | 1107 KiB | 15 Q