3v4l.org

run code in 300+ PHP versions simultaneously
<?php function assign_foo($instance) { $instance->foo = 2; } final class Content { protected $data; public function __get(string $name) { return $this->data[$name]; } public function __set(string $name, mixed $value): void { if ($value === 1) { assign_foo($this); } else { $this->data[$name] = $value; } } } $content = new Content(); $content->foo = 1;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/smIKL
function name:  (null)
number of ops:  6
compiled vars:  !0 = $content
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   NEW                                              $1      'Content'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   24     3        ASSIGN_OBJ                                               !0, 'foo'
          4        OP_DATA                                                  1
   25     5      > RETURN                                                   1

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

End of function assign_foo

Class Content:
Function __get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/smIKL
function name:  __get
number of ops:  5
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
   11     1        FETCH_OBJ_R                                      ~1      'data'
          2        FETCH_DIM_R                                      ~2      ~1, !0
          3      > RETURN                                                   ~2
   12     4*     > RETURN                                                   null

End of function __get

Function __set:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 9
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: 9
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/smIKL
function name:  __set
number of ops:  13
compiled vars:  !0 = $name, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   15     2        IS_IDENTICAL                                             !1, 1
          3      > JMPZ                                                     ~2, ->9
   16     4    >   INIT_FCALL                                               'assign_foo'
          5        FETCH_THIS                                       ~3      
          6        SEND_VAL                                                 ~3
          7        DO_FCALL                                      0          
   15     8      > JMP                                                      ->12
   18     9    >   FETCH_OBJ_W                                      $5      'data'
         10        ASSIGN_DIM                                               $5, !0
         11        OP_DATA                                                  !1
   20    12    > > RETURN                                                   null

End of function __set

End of class Content.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.11 ms | 1438 KiB | 14 Q