3v4l.org

run code in 500+ PHP versions simultaneously
<?php trait PersonPL{ public function sayHello($name){ echo 'Witaj, nazywam siÄ™ '.$name; } public function whereFrom($country){ echo 'Jestem z '.$country; } } trait PersonENG{ public function sayHello($name){ echo 'Hi, my name is '.$name; } public function whereFrom($country){ echo 'I am form '.$country; } } trait PersonDE{ public function sayHello($name){ echo 'Hallo! Mein Name ist '.$name; } public function whereFrom($country){ echo 'Ich komme aus '.$country; } } class TestB{ use PersonPL, PersonENG, PersonDE{ PersonPL::sayHello insteadof PersonENG, PersonDE; PersonPL::whereFrom insteadof PersonENG, PersonDE; } } $objectB = new TestB(); $objectB->sayHello('Anna'); $objectB->sayHello('Polski');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TCAjD
function name:  (null)
number of ops:  11
compiled vars:  !0 = $objectB
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   33     0  E >   DECLARE_CLASS                                                'testb'
   41     1        NEW                                                  $1      'TestB'
          2        DO_FCALL                                          0          
          3        ASSIGN                                                       !0, $1
   42     4        INIT_METHOD_CALL                                             !0, 'sayHello'
          5        SEND_VAL_EX                                                  'Anna'
          6        DO_FCALL                                          0          
   43     7        INIT_METHOD_CALL                                             !0, 'sayHello'
          8        SEND_VAL_EX                                                  'Polski'
          9        DO_FCALL                                          0          
         10      > RETURN                                                       1

Class PersonPL:
Function sayhello:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TCAjD
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      'Witaj%2C+nazywam+si%C4%99+', !0
          2        ECHO                                                         ~1
    6     3      > RETURN                                                       null

End of function sayhello

Function wherefrom:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TCAjD
function name:  whereFrom
number of ops:  4
compiled vars:  !0 = $country
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    8     0  E >   RECV                                                 !0      
    9     1        CONCAT                                               ~1      'Jestem+z+', !0
          2        ECHO                                                         ~1
   10     3      > RETURN                                                       null

End of function wherefrom

End of class PersonPL.

Class PersonENG:
Function sayhello:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TCAjD
function name:  sayHello
number of ops:  4
compiled vars:  !0 = $name
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   14     0  E >   RECV                                                 !0      
   15     1        CONCAT                                               ~1      'Hi%2C+my+name+is+', !0
          2        ECHO                                                         ~1
   16     3      > RETURN                                                       null

End of function sayhello

Function wherefrom:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TCAjD
function name:  whereFrom
number of ops:  4
compiled vars:  !0 = $country
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   18     0  E >   RECV                                                 !0      
   19     1        CONCAT                                               ~1      'I+am+form+', !0
          2        ECHO                                                         ~1
   20     3      > RETURN                                                       null

End of function wherefrom

End of class PersonENG.

Class PersonDE:
Function sayhello:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TCAjD
function name:  sayHello
number of ops:  4
compiled vars:  !0 = $name
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   24     0  E >   RECV                                                 !0      
   25     1        CONCAT                                               ~1      'Hallo%21+Mein+Name+ist+', !0
          2        ECHO                                                         ~1
   26     3      > RETURN                                                       null

End of function sayhello

Function wherefrom:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TCAjD
function name:  whereFrom
number of ops:  4
compiled vars:  !0 = $country
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   28     0  E >   RECV                                                 !0      
   29     1        CONCAT                                               ~1      'Ich+komme+aus++', !0
          2        ECHO                                                         ~1
   30     3      > RETURN                                                       null

End of function wherefrom

End of class PersonDE.

Class TestB: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
165.28 ms | 2129 KiB | 13 Q