3v4l.org

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

Class test:
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/hMImt
function name:  __get
number of ops:  13
compiled vars:  !0 = $name, !1 = $a
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    8     0  E >   RECV                                                 !0      
    9     1        IS_IDENTICAL                                                 !0, 'container'
          2      > JMPZ                                                         ~2, ->12
   10     3    >   NEW                                                  $3      'stdClass'
          4        DO_FCALL                                          0          
          5        ASSIGN                                                       !1, $3
   11     6        INIT_FCALL                                                   'random_bytes'
          7        SEND_VAL                                                     7
          8        DO_ICALL                                             $7      
          9        ASSIGN_OBJ                                                   !1, 'test'
         10        OP_DATA                                                      $7
   12    11      > RETURN                                                       !1
   14    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/hMImt
function name:  __set
number of ops:  5
compiled vars:  !0 = $name, !1 = $value
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   16     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
   17     2        IS_IDENTICAL                                                 !0, 'container'
          3      > JMPZ                                                         ~2, ->4
   19     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/hMImt
function name:  blah
number of ops:  3
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   22     0  E >   ASSIGN_OBJ                                                   'container'
          1        OP_DATA                                                      'test'
   23     2      > RETURN                                                       null

End of function blah

End of class test.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
148.33 ms | 1436 KiB | 15 Q