3v4l.org

run code in 300+ 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; PersonENG::sayHello insteadof PersonPL; PersonPL::whereFrom insteadof PersonENG; } } $objA = new TestA(); $objA->sayHello('Anna'); $objA->whereFrom('Polski');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KtBk0
function name:  (null)
number of ops:  11
compiled vars:  !0 = $objA
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   DECLARE_CLASS                                            'testa'
   34     1        NEW                                              $1      'TestA'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   35     4        INIT_METHOD_CALL                                         !0, 'sayHello'
          5        SEND_VAL_EX                                              'Anna'
          6        DO_FCALL                                      0          
   36     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/KtBk0
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/KtBk0
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/KtBk0
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/KtBk0
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.0.0


preferences:
154.65 ms | 1399 KiB | 13 Q