3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait theTrait { protected function test($a, $x=[]) { echo $a; } } class theClass { use theTrait; } class theExtend extends theClass { protected function test($a) { echo 'prefixed: ' . $a; } } $x = new theClass;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/iedIW
function name:  (null)
number of ops:  6
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   DECLARE_CLASS                                            'theclass'
   16     1        DECLARE_CLASS                                            'theextend', 'theclass'
   23     2        NEW                                              $1      'theClass'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $1
   24     5      > RETURN                                                   1

Class theTrait:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/iedIW
function name:  test
number of ops:  4
compiled vars:  !0 = $a, !1 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      <array>
    6     2        ECHO                                                     !0
    7     3      > RETURN                                                   null

End of function test

End of class theTrait.

Class theClass: [no user functions]
Class theExtend:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/iedIW
function name:  test
number of ops:  4
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
   18     1        CONCAT                                           ~1      'prefixed%3A+', !0
          2        ECHO                                                     ~1
   19     3      > RETURN                                                   null

End of function test

End of class theExtend.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
12.78 ms | 411 KiB | 7 Q