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; } } } set_error_handler(function () { echo (new Exception)->getTraceAsString(); }); $content = new Content(); $content->foo = 1;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YtnAhT
function name:  (null)
number of ops:  10
compiled vars:  !0 = $content
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   INIT_FCALL                                               'set_error_handler'
          1        DECLARE_LAMBDA_FUNCTION                          ~1      [0]
   25     2        SEND_VAL                                                 ~1
   23     3        DO_ICALL                                                 
   27     4        NEW                                              $3      'Content'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !0, $3
   28     7        ASSIGN_OBJ                                               !0, 'foo'
          8        OP_DATA                                                  1
   29     9      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YtnAhT
function name:  {closure}
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   NEW                                              $0      'Exception'
          1        DO_FCALL                                      0          
          2        INIT_METHOD_CALL                                         $0, 'getTraceAsString'
          3        DO_FCALL                                      0  $2      
          4        ECHO                                                     $2
   25     5      > RETURN                                                   null

End of Dynamic Function 0

Function assign_foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YtnAhT
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/YtnAhT
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/YtnAhT
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.17 ms | 1452 KiB | 15 Q