3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait Evil { public function say($msg) { echo 'I am evil! ' . $msg; } } class Human { use Evil; public function say($msg) { echo 'I am not evil, even though I should say it after this anyway.'; Evil::say($msg); } } (new Human)->say('Hello World');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KI7ec
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   DECLARE_CLASS                                            'human'
   17     1        NEW                                              $0      'Human'
          2        DO_FCALL                                      0          
          3        INIT_METHOD_CALL                                         $0, 'say'
          4        SEND_VAL_EX                                              'Hello+World'
          5        DO_FCALL                                      0          
          6      > RETURN                                                   1

Class Evil:
Function say:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KI7ec
function name:  say
number of ops:  4
compiled vars:  !0 = $msg
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        CONCAT                                           ~1      'I+am+evil%21+', !0
          2        ECHO                                                     ~1
          3      > RETURN                                                   null

End of function say

End of class Evil.

Class Human:
Function say:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KI7ec
function name:  say
number of ops:  6
compiled vars:  !0 = $msg
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
   11     1        ECHO                                                     'I+am+not+evil%2C+even+though+I+should+say+it+after+this+anyway.'
   13     2        INIT_STATIC_METHOD_CALL                                  'Evil', 'say'
          3        SEND_VAR                                                 !0
          4        DO_FCALL                                      0          
   14     5      > RETURN                                                   null

End of function say

End of class Human.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
197.98 ms | 1394 KiB | 13 Q