3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait T { protected $prop = "foo"; public function setProp($value) { $this->prop = $value; } } class Bar{ use T; public function __construct() { $this->setProp("bar"); } public function show(){ echo $this->prop; } } $x = new Bar; $x->show();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fBJNr
function name:  (null)
number of ops:  7
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   DECLARE_CLASS                                            'bar'
   25     1        NEW                                              $1      'Bar'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   26     4        INIT_METHOD_CALL                                         !0, 'show'
          5        DO_FCALL                                      0          
          6      > RETURN                                                   1

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

End of function setprop

End of class T.

Class Bar:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fBJNr
function name:  __construct
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   INIT_METHOD_CALL                                         'setProp'
          1        SEND_VAL_EX                                              'bar'
          2        DO_FCALL                                      0          
   19     3      > RETURN                                                   null

End of function __construct

Function show:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fBJNr
function name:  show
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   FETCH_OBJ_R                                      ~0      'prop'
          1        ECHO                                                     ~0
          2      > RETURN                                                   null

End of function show

End of class Bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.68 ms | 1395 KiB | 13 Q