3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { protected $bar = 'test'; public function __get($property) { return isset($this->$property) ? $this->$property : null; } } $foo = new Foo(); var_dump($foo->bar);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/amN0B
function name:  (null)
number of ops:  8
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   NEW                                              $1      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   16     3        INIT_FCALL                                               'var_dump'
          4        FETCH_OBJ_R                                      ~4      !0, 'bar'
          5        SEND_VAL                                                 ~4
          6        DO_ICALL                                                 
          7      > RETURN                                                   1

Class Foo:
Function __get:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 6
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/amN0B
function name:  __get
number of ops:  9
compiled vars:  !0 = $property
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    7     1        ISSET_ISEMPTY_PROP_OBJ                                   !0
          2      > JMPZ                                                     ~1, ->6
          3    >   FETCH_OBJ_R                                      ~2      !0
          4        QM_ASSIGN                                        ~3      ~2
          5      > JMP                                                      ->7
          6    >   QM_ASSIGN                                        ~3      null
          7    > > RETURN                                                   ~3
    8     8*     > RETURN                                                   null

End of function __get

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.07 ms | 1395 KiB | 15 Q