3v4l.org

run code in 300+ PHP versions simultaneously
<?php class foo { private $bar = null; public function __set($name, $value) { if ($name == 'bar') $this->bar = $value . $value; else throw new Exception('Property does not exists'); } public function __get($name) { if ($name == 'bar') return $this->bar; else throw new Exception('Property does not exists'); } } $obj = new foo(); $obj->bar = '123'; echo $obj->bar;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0POt4
function name:  (null)
number of ops:  8
compiled vars:  !0 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   NEW                                              $1      'foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   27     3        ASSIGN_OBJ                                               !0, 'bar'
          4        OP_DATA                                                  '123'
   28     5        FETCH_OBJ_R                                      ~5      !0, 'bar'
          6        ECHO                                                     ~5
          7      > RETURN                                                   1

Class foo:
Function __set:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 8
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/0POt4
function name:  __set
number of ops:  13
compiled vars:  !0 = $name, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   10     2        IS_EQUAL                                                 !0, 'bar'
          3      > JMPZ                                                     ~2, ->8
   11     4    >   CONCAT                                           ~4      !1, !1
          5        ASSIGN_OBJ                                               'bar'
          6        OP_DATA                                                  ~4
          7      > JMP                                                      ->12
   13     8    >   NEW                                              $5      'Exception'
          9        SEND_VAL_EX                                              'Property+does+not+exists'
         10        DO_FCALL                                      0          
         11      > THROW                                         0          $5
   14    12    > > RETURN                                                   null

End of function __set

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 = 62) Position 1 = -2
Branch analysis from position: 6
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/0POt4
function name:  __get
number of ops:  11
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   RECV                                             !0      
   18     1        IS_EQUAL                                                 !0, 'bar'
          2      > JMPZ                                                     ~1, ->6
   19     3    >   FETCH_OBJ_R                                      ~2      'bar'
          4      > RETURN                                                   ~2
          5*       JMP                                                      ->10
   21     6    >   NEW                                              $3      'Exception'
          7        SEND_VAL_EX                                              'Property+does+not+exists'
          8        DO_FCALL                                      0          
          9      > THROW                                         0          $3
   22    10*     > RETURN                                                   null

End of function __get

End of class foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.84 ms | 1399 KiB | 13 Q