3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait User { public function greet($name) { print "Hello, " . $name . PHP_EOL; } public function sayBye($name) { print "Good bye, " . $name . PHP_EOL; } } trait BigParent { public function giveBirth($child_name) { print "Created child: " . $child_name . PHP_EOL; } } class Person { use User; use BigParent; } $person = new Person(); $person->greet("foo"); $person->sayBye("bar"); $person->giveBirth("baz");
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lcZJX
function name:  (null)
number of ops:  14
compiled vars:  !0 = $person
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   DECLARE_CLASS                                            'person'
   28     1        NEW                                              $1      'Person'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   29     4        INIT_METHOD_CALL                                         !0, 'greet'
          5        SEND_VAL_EX                                              'foo'
          6        DO_FCALL                                      0          
   30     7        INIT_METHOD_CALL                                         !0, 'sayBye'
          8        SEND_VAL_EX                                              'bar'
          9        DO_FCALL                                      0          
   31    10        INIT_METHOD_CALL                                         !0, 'giveBirth'
         11        SEND_VAL_EX                                              'baz'
         12        DO_FCALL                                      0          
         13      > RETURN                                                   1

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

End of function greet

Function saybye:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lcZJX
function name:  sayBye
number of ops:  5
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
   10     1        CONCAT                                           ~1      'Good+bye%2C+', !0
          2        CONCAT                                           ~2      ~1, '%0A'
          3        ECHO                                                     ~2
   11     4      > RETURN                                                   null

End of function saybye

End of class User.

Class BigParent:
Function givebirth:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lcZJX
function name:  giveBirth
number of ops:  5
compiled vars:  !0 = $child_name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
   18     1        CONCAT                                           ~1      'Created+child%3A+', !0
          2        CONCAT                                           ~2      ~1, '%0A'
          3        ECHO                                                     ~2
   19     4      > RETURN                                                   null

End of function givebirth

End of class BigParent.

Class Person: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.61 ms | 1403 KiB | 13 Q