3v4l.org

run code in 300+ PHP versions simultaneously
<?php class FooBar { private $data = array(); public function __set($name, $value) { $this->data[$name] = $value; } public function __get($name) { if (array_key_exists($name, $this->data)) { return $this->data[$name] + 2; } } } $myFooBar = new FooBar(); $myFooBar->myVar = 5; echo $myFooBar->myVar + 3;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AYS8R
function name:  (null)
number of ops:  9
compiled vars:  !0 = $myFooBar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   NEW                                              $1      'FooBar'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   17     3        ASSIGN_OBJ                                               !0, 'myVar'
          4        OP_DATA                                                  5
   18     5        FETCH_OBJ_R                                      ~5      !0, 'myVar'
          6        ADD                                              ~6      ~5, 3
          7        ECHO                                                     ~6
          8      > RETURN                                                   1

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

End of function __set

Function __get:
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 = 62) Position 1 = -2
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AYS8R
function name:  __get
number of ops:  9
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
   10     1        FETCH_OBJ_R                                      ~1      'data'
          2        ARRAY_KEY_EXISTS                                         !0, ~1
          3      > JMPZ                                                     ~2, ->8
   11     4    >   FETCH_OBJ_R                                      ~3      'data'
          5        FETCH_DIM_R                                      ~4      ~3, !0
          6        ADD                                              ~5      ~4, 2
          7      > RETURN                                                   ~5
   13     8    > > RETURN                                                   null

End of function __get

End of class FooBar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.76 ms | 1395 KiB | 13 Q