3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait X { static protected $var; } class XA { use X; static public function setVar($v) { self::$var = $v; } static public function getVar() { return self::$var; } } class XB { use X; static public function setVar($v) { self::$var = $v; } static public function getVar() { return self::$var; } } XA::setVar(1); echo XB::getVar();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/75Wjp
function name:  (null)
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   DECLARE_CLASS                                            'xa'
   21     1        DECLARE_CLASS                                            'xb'
   37     2        INIT_STATIC_METHOD_CALL                                  'XA', 'setVar'
          3        SEND_VAL_EX                                              1
          4        DO_FCALL                                      0          
   38     5        INIT_STATIC_METHOD_CALL                                  'XB', 'getVar'
          6        DO_FCALL                                      0  $1      
          7        ECHO                                                     $1
          8      > RETURN                                                   1

Class X: [no user functions]
Class XA:
Function setvar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/75Wjp
function name:  setVar
number of ops:  4
compiled vars:  !0 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
   12     1        ASSIGN_STATIC_PROP                                       'var'
          2        OP_DATA                                                  !0
   13     3      > RETURN                                                   null

End of function setvar

Function getvar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/75Wjp
function name:  getVar
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   FETCH_STATIC_PROP_R          unknown             ~0      'var'
          1      > RETURN                                                   ~0
   18     2*     > RETURN                                                   null

End of function getvar

End of class XA.

Class XB:
Function setvar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/75Wjp
function name:  setVar
number of ops:  4
compiled vars:  !0 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   RECV                                             !0      
   27     1        ASSIGN_STATIC_PROP                                       'var'
          2        OP_DATA                                                  !0
   28     3      > RETURN                                                   null

End of function setvar

Function getvar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/75Wjp
function name:  getVar
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   32     0  E >   FETCH_STATIC_PROP_R          unknown             ~0      'var'
          1      > RETURN                                                   ~0
   33     2*     > RETURN                                                   null

End of function getvar

End of class XB.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.02 ms | 1399 KiB | 13 Q