3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { private $fooId; private $fooName; public function __set($name, $value) { $this->$name = $value; } public function __get($name) { if (self::__isset($name)) { return $this->$name; } $trace = debug_backtrace(); trigger_error( 'Undefined property via __get(): ' . $name . ' in ' . $trace[0]['file'] . ' on line ' . $trace[0]['line'], E_USER_NOTICE); return null; } public function __isset($name) { return isset($this->$name); } } $bar = new Foo(); $bar->fooId = 2; $bar->fooName = 'Name'; var_dump($bar); printf($bar->check);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AEAlh
function name:  (null)
number of ops:  15
compiled vars:  !0 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   34     0  E >   NEW                                              $1      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   36     3        ASSIGN_OBJ                                               !0, 'fooId'
          4        OP_DATA                                                  2
   37     5        ASSIGN_OBJ                                               !0, 'fooName'
          6        OP_DATA                                                  'Name'
   39     7        INIT_FCALL                                               'var_dump'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                                 
   41    10        INIT_FCALL                                               'printf'
         11        FETCH_OBJ_R                                      ~7      !0, 'check'
         12        SEND_VAL                                                 ~7
         13        DO_ICALL                                                 
         14      > RETURN                                                   1

Class Foo:
Function __set:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AEAlh
function name:  __set
number of ops:  5
compiled vars:  !0 = $name, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    9     2        ASSIGN_OBJ                                               !0
          3        OP_DATA                                                  !1
   10     4      > RETURN                                                   null

End of function __set

Function __get:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 7
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AEAlh
function name:  __get
number of ops:  25
compiled vars:  !0 = $name, !1 = $trace
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
   14     1        INIT_STATIC_METHOD_CALL                                  '__isset'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0  $2      
          4      > JMPZ                                                     $2, ->7
   15     5    >   FETCH_OBJ_R                                      ~3      !0
          6      > RETURN                                                   ~3
   18     7    >   INIT_FCALL                                               'debug_backtrace'
          8        DO_ICALL                                         $4      
          9        ASSIGN                                                   !1, $4
   19    10        INIT_FCALL                                               'trigger_error'
   20    11        CONCAT                                           ~6      'Undefined+property+via+__get%28%29%3A+', !0
   21    12        CONCAT                                           ~7      ~6, '+in+'
         13        FETCH_DIM_R                                      ~8      !1, 0
         14        FETCH_DIM_R                                      ~9      ~8, 'file'
         15        CONCAT                                           ~10     ~7, ~9
   22    16        CONCAT                                           ~11     ~10, '+on+line+'
         17        FETCH_DIM_R                                      ~12     !1, 0
         18        FETCH_DIM_R                                      ~13     ~12, 'line'
         19        CONCAT                                           ~14     ~11, ~13
         20        SEND_VAL                                                 ~14
   23    21        SEND_VAL                                                 1024
         22        DO_ICALL                                                 
   24    23      > RETURN                                                   null
   25    24*     > 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/AEAlh
function name:  __isset
number of ops:  4
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     0  E >   RECV                                             !0      
   29     1        ISSET_ISEMPTY_PROP_OBJ                           ~1      !0
          2      > RETURN                                                   ~1
   30     3*     > RETURN                                                   null

End of function __isset

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.6 ms | 1405 KiB | 21 Q