3v4l.org

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

Class A:
Function calc1:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HApXQ
function name:  calc1
number of ops:  3
compiled vars:  !0 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        ECHO                                                     '%2F+calc1+trait+%2F'
    5     2      > 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/HApXQ
function name:  calc
number of ops:  3
compiled vars:  !0 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    7     1        ECHO                                                     '%2F+calc+trait+%2F'
    8     2      > 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/HApXQ
function name:  calc
number of ops:  6
compiled vars:  !0 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
   15     1        ECHO                                                     '%2F+calc+class+%2F'
   16     2        INIT_METHOD_CALL                                         'calc'
          3        SEND_VAL_EX                                              5
          4        DO_FCALL                                      0          
   18     5      > RETURN                                                   null

End of function calc

End of class MyClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.32 ms | 1395 KiB | 13 Q