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; } } class TestA{ use PersonPL, PersonENG{ PersonPL::sayHello insteadof PersonENG; PersonPL::whereFrom insteadof PersonENG; } } $objectA = new TestA(); $objectA->sayHello("Anna"); $objectA->whereFrom("Polski");
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DBAeB
function name:  (null)
number of ops:  11
compiled vars:  !0 = $objectA
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   23     0  E >   DECLARE_CLASS                                                'testa'
   31     1        NEW                                                  $1      'TestA'
          2        DO_FCALL                                          0          
          3        ASSIGN                                                       !0, $1
   32     4        INIT_METHOD_CALL                                             !0, 'sayHello'
          5        SEND_VAL_EX                                                  'Anna'
          6        DO_FCALL                                          0          
   33     7        INIT_METHOD_CALL                                             !0, 'whereFrom'
          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/DBAeB
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/DBAeB
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/DBAeB
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/DBAeB
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 TestA: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
212.56 ms | 2725 KiB | 13 Q