3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait Hash { public function generateId() { return uniqid(); } public function generateMD5($param) { return md5($param); } } trait HtmlDecorator { public function decorateHtml($param) { return '<html>'.$param.'</html>'; } public function decorateBold($param) { return '<b>'.$param.'</b>'; } public function decorateBody($param) { return '<body>'.$param.'</body>'; } } interface Hashable { function generateMD5($param); } class User implements Hashable { use HtmlDecorator,Hash; } print (new User())->generateMD5("Kevin"); $user_inst=new User(); print $user_inst->decorateBody($user_inst->decorateBold('Kevin'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cMMWr
function name:  (null)
number of ops:  18
compiled vars:  !0 = $user_inst
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   33     0  E >   DECLARE_CLASS                                            'user'
   38     1        NEW                                              $1      'User'
          2        DO_FCALL                                      0          
          3        INIT_METHOD_CALL                                         $1, 'generateMD5'
          4        SEND_VAL_EX                                              'Kevin'
          5        DO_FCALL                                      0  $3      
          6        ECHO                                                     $3
   39     7        NEW                                              $4      'User'
          8        DO_FCALL                                      0          
          9        ASSIGN                                                   !0, $4
   41    10        INIT_METHOD_CALL                                         !0, 'decorateBody'
         11        INIT_METHOD_CALL                                         !0, 'decorateBold'
         12        SEND_VAL_EX                                              'Kevin'
         13        DO_FCALL                                      0  $7      
         14        SEND_VAR_NO_REF_EX                                       $7
         15        DO_FCALL                                      0  $8      
         16        ECHO                                                     $8
         17      > RETURN                                                   1

Class Hash:
Function generateid:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cMMWr
function name:  generateId
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   INIT_FCALL                                               'uniqid'
          1        DO_ICALL                                         $0      
          2      > RETURN                                                   $0
    7     3*     > RETURN                                                   null

End of function generateid

Function generatemd5:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cMMWr
function name:  generateMD5
number of ops:  6
compiled vars:  !0 = $param
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
   10     1        INIT_FCALL                                               'md5'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $1      
          4      > RETURN                                                   $1
   11     5*     > RETURN                                                   null

End of function generatemd5

End of class Hash.

Class HtmlDecorator:
Function decoratehtml:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cMMWr
function name:  decorateHtml
number of ops:  5
compiled vars:  !0 = $param
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
   17     1        CONCAT                                           ~1      '%3Chtml%3E', !0
          2        CONCAT                                           ~2      ~1, '%3C%2Fhtml%3E'
          3      > RETURN                                                   ~2
   18     4*     > RETURN                                                   null

End of function decoratehtml

Function decoratebold:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cMMWr
function name:  decorateBold
number of ops:  5
compiled vars:  !0 = $param
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   RECV                                             !0      
   21     1        CONCAT                                           ~1      '%3Cb%3E', !0
          2        CONCAT                                           ~2      ~1, '%3C%2Fb%3E'
          3      > RETURN                                                   ~2
   22     4*     > RETURN                                                   null

End of function decoratebold

Function decoratebody:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cMMWr
function name:  decorateBody
number of ops:  5
compiled vars:  !0 = $param
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   RECV                                             !0      
   25     1        CONCAT                                           ~1      '%3Cbody%3E', !0
          2        CONCAT                                           ~2      ~1, '%3C%2Fbody%3E'
          3      > RETURN                                                   ~2
   26     4*     > RETURN                                                   null

End of function decoratebody

End of class HtmlDecorator.

Class Hashable:
Function generatemd5:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cMMWr
function name:  generateMD5
number of ops:  2
compiled vars:  !0 = $param
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   31     0  E >   RECV                                             !0      
          1      > RETURN                                                   null

End of function generatemd5

End of class Hashable.

Class User: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.62 ms | 1400 KiB | 17 Q