3v4l.org

run code in 500+ PHP versions simultaneously
<?php trait A { private $value = 1; public function getValue() { return $this->value; } public function __set($name, $val) { var_dump($name, $val); } } class B { use A; public function setValue($value) { // Prior to v7.3, "A::__set()" would be triggered here. $this->value = $value; } } $B = new B(); var_dump($B->getValue()); $B->setValue(12); var_dump($B->getValue());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5XSGH
function name:  (null)
number of ops:  18
compiled vars:  !0 = $B
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   17     0  E >   DECLARE_CLASS                                                'b'
   28     1        NEW                                                  $1      'B'
          2        DO_FCALL                                          0          
          3        ASSIGN                                                       !0, $1
   29     4        INIT_FCALL                                                   'var_dump'
          5        INIT_METHOD_CALL                                             !0, 'getValue'
          6        DO_FCALL                                          0  $4      
          7        SEND_VAR                                                     $4
          8        DO_ICALL                                                     
   30     9        INIT_METHOD_CALL                                             !0, 'setValue'
         10        SEND_VAL_EX                                                  12
         11        DO_FCALL                                          0          
   31    12        INIT_FCALL                                                   'var_dump'
         13        INIT_METHOD_CALL                                             !0, 'getValue'
         14        DO_FCALL                                          0  $7      
         15        SEND_VAR                                                     $7
         16        DO_ICALL                                                     
         17      > RETURN                                                       1

Class A:
Function getvalue:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5XSGH
function name:  getValue
number of ops:  3
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    8     0  E >   FETCH_OBJ_R                                          ~0      'value'
          1      > RETURN                                                       ~0
    9     2*     > RETURN                                                       null

End of function getvalue

Function __set:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5XSGH
function name:  __set
number of ops:  7
compiled vars:  !0 = $name, !1 = $val
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   11     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
   12     2        INIT_FCALL                                                   'var_dump'
          3        SEND_VAR                                                     !0
          4        SEND_VAR                                                     !1
          5        DO_ICALL                                                     
   13     6      > RETURN                                                       null

End of function __set

End of class A.

Class B:
Function setvalue:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5XSGH
function name:  setValue
number of ops:  4
compiled vars:  !0 = $value
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   21     0  E >   RECV                                                 !0      
   23     1        ASSIGN_OBJ                                                   'value'
          2        OP_DATA                                                      !0
   24     3      > RETURN                                                       null

End of function setvalue

End of class B.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
153.29 ms | 1485 KiB | 9 Q