3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Basic{ public function sayHello($name){ echo 'Hello world! I am '.$name; } } trait TraitMethod{ public function sayHello($name){ echo 'Hello! My name is '.$name; } } class TestC extends Basic{ use TraitMethod{ TraitMethod::sayHello as sayHelloTrait; } public function sayHello($name){ parent::sayHello($name); $this->sayHelloTrait($name); } } $objTestC = new TestC(); $objTestC->sayHello("Anna");
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MVnpo
function name:  (null)
number of ops:  8
compiled vars:  !0 = $objTestC
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   15     0  E >   DECLARE_CLASS                                                'testc', 'basic'
   26     1        NEW                                                  $1      'TestC'
          2        DO_FCALL                                          0          
          3        ASSIGN                                                       !0, $1
   27     4        INIT_METHOD_CALL                                             !0, 'sayHello'
          5        SEND_VAL_EX                                                  'Anna'
          6        DO_FCALL                                          0          
          7      > RETURN                                                       1

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

End of function sayhello

End of class Basic.

Class TraitMethod:
Function sayhello:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MVnpo
function name:  sayHello
number of ops:  4
compiled vars:  !0 = $name
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   10     0  E >   RECV                                                 !0      
   11     1        CONCAT                                               ~1      'Hello%21+My+name+is+', !0
          2        ECHO                                                         ~1
   12     3      > RETURN                                                       null

End of function sayhello

End of class TraitMethod.

Class TestC:
Function sayhello:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MVnpo
function name:  sayHello
number of ops:  8
compiled vars:  !0 = $name
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   20     0  E >   RECV                                                 !0      
   21     1        INIT_STATIC_METHOD_CALL                                      'sayHello'
          2        SEND_VAR_EX                                                  !0
          3        DO_FCALL                                          0          
   22     4        INIT_METHOD_CALL                                             'sayHelloTrait'
          5        SEND_VAR_EX                                                  !0
          6        DO_FCALL                                          0          
   23     7      > RETURN                                                       null

End of function sayhello

End of class TestC.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
139.33 ms | 2728 KiB | 13 Q