3v4l.org

run code in 500+ PHP versions simultaneously
<?php /** * @property string $value */ class Example { private $value; public function __construct() { $this->value = "test"; } public function __get($key) { if (property_exists($this, $key)) { return $this->{$key}; } else { return null; // or throw an exception } } public function __set($key, $value) { return; // or throw an exception } } $example = new Example(); var_dump($example->value); $example->value = "invalid"; var_dump($example->value);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MFavG
function name:  (null)
number of ops:  14
compiled vars:  !0 = $example
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   30     0  E >   NEW                                                  $1      'Example'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $1
   31     3        INIT_FCALL                                                   'var_dump'
          4        FETCH_OBJ_R                                          ~4      !0, 'value'
          5        SEND_VAL                                                     ~4
          6        DO_ICALL                                                     
   32     7        ASSIGN_OBJ                                                   !0, 'value'
          8        OP_DATA                                                      'invalid'
   33     9        INIT_FCALL                                                   'var_dump'
         10        FETCH_OBJ_R                                          ~7      !0, 'value'
         11        SEND_VAL                                                     ~7
         12        DO_ICALL                                                     
         13      > RETURN                                                       1

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

End of function __construct

Function __get:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 7
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MFavG
function name:  __get
number of ops:  9
compiled vars:  !0 = $key
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   15     0  E >   RECV                                                 !0      
   17     1        FETCH_THIS                                           ~1      
          2        FRAMELESS_ICALL_2                property_exists      ~2      ~1, !0
          3      > JMPZ                                                         ~2, ->7
   18     4    >   FETCH_OBJ_R                                          ~3      !0
          5      > RETURN                                                       ~3
   17     6*       JMP                                                          ->8
   20     7    > > RETURN                                                       null
   22     8*     > RETURN                                                       null

End of function __get

Function __set:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MFavG
function name:  __set
number of ops:  4
compiled vars:  !0 = $key, !1 = $value
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   24     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
   26     2      > RETURN                                                       null
   27     3*     > RETURN                                                       null

End of function __set

End of class Example.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
154.15 ms | 2210 KiB | 14 Q