3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public $pr1 = 'v1'; protected $pr2 = 'v2'; public function __get($name) { if ($name === 'bar') { return 'FUBAR'; } return null; } public function __isset($name) { return $name === 'bar'; } } $foo = new Foo(); var_dump($foo->pr1); var_dump($foo->bar); var_dump($foo->pr2);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OB9KC
function name:  (null)
number of ops:  16
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   NEW                                              $1      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   21     3        INIT_FCALL                                               'var_dump'
          4        FETCH_OBJ_R                                      ~4      !0, 'pr1'
          5        SEND_VAL                                                 ~4
          6        DO_ICALL                                                 
   22     7        INIT_FCALL                                               'var_dump'
          8        FETCH_OBJ_R                                      ~6      !0, 'bar'
          9        SEND_VAL                                                 ~6
         10        DO_ICALL                                                 
   23    11        INIT_FCALL                                               'var_dump'
         12        FETCH_OBJ_R                                      ~8      !0, 'pr2'
         13        SEND_VAL                                                 ~8
         14        DO_ICALL                                                 
         15      > RETURN                                                   1

Class Foo:
Function __get:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 4
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OB9KC
function name:  __get
number of ops:  6
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
    9     1        IS_IDENTICAL                                             !0, 'bar'
          2      > JMPZ                                                     ~1, ->4
   10     3    > > RETURN                                                   'FUBAR'
   12     4    > > RETURN                                                   null
   13     5*     > RETURN                                                   null

End of function __get

Function __isset:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OB9KC
function name:  __isset
number of ops:  4
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
   16     1        IS_IDENTICAL                                     ~1      !0, 'bar'
          2      > RETURN                                                   ~1
   17     3*     > RETURN                                                   null

End of function __isset

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.14 ms | 1396 KiB | 15 Q