3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait A { function calc1($v) { echo '/ calc1 trait /'.$this->x; } function calc($v) { echo '/ calc trait /'.$this->x; } } class MyClass { use A; public $x; function calc($v) { echo '/ calc class /'; A::calc1(5); //parent::calc($v); } } $x=new MyClass(); $x->x = 5; $x->calc(123);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oIZPD
function name:  (null)
number of ops:  10
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   DECLARE_CLASS                                            'myclass'
   22     1        NEW                                              $1      'MyClass'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   23     4        ASSIGN_OBJ                                               !0, 'x'
          5        OP_DATA                                                  5
   24     6        INIT_METHOD_CALL                                         !0, 'calc'
          7        SEND_VAL_EX                                              123
          8        DO_FCALL                                      0          
          9      > RETURN                                                   1

Class A:
Function calc1:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oIZPD
function name:  calc1
number of ops:  5
compiled vars:  !0 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        FETCH_OBJ_R                                      ~1      'x'
          2        CONCAT                                           ~2      '%2F+calc1+trait+%2F', ~1
          3        ECHO                                                     ~2
    5     4      > RETURN                                                   null

End of function calc1

Function calc:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oIZPD
function name:  calc
number of ops:  5
compiled vars:  !0 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    7     1        FETCH_OBJ_R                                      ~1      'x'
          2        CONCAT                                           ~2      '%2F+calc+trait+%2F', ~1
          3        ECHO                                                     ~2
    8     4      > RETURN                                                   null

End of function calc

End of class A.

Class MyClass:
Function calc:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oIZPD
function name:  calc
number of ops:  6
compiled vars:  !0 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
   16     1        ECHO                                                     '%2F+calc+class+%2F'
   17     2        INIT_STATIC_METHOD_CALL                                  'A', 'calc1'
          3        SEND_VAL                                                 5
          4        DO_FCALL                                      0          
   19     5      > RETURN                                                   null

End of function calc

End of class MyClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.42 ms | 1395 KiB | 13 Q