3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait MauricioTrait { public function sumStuff($a, $b) { return $a + $b; } public function multiplyStuff($a, $b) { return $a * $b; } } class MauricioClass { use MauricioTrait; public function printStuff() { return "Hello world!"; } } var_dump(method_exists(MauricioClass, 'sumStuff')); var_dump(in_array('MauricioTrait', class_uses('MauricioClass')));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SPXS4
function name:  (null)
number of ops:  20
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   DECLARE_CLASS                                            'mauricioclass'
   13     1        INIT_FCALL                                               'var_dump'
          2        INIT_FCALL                                               'method_exists'
          3        FETCH_CONSTANT                                   ~0      'MauricioClass'
          4        SEND_VAL                                                 ~0
          5        SEND_VAL                                                 'sumStuff'
          6        DO_ICALL                                         $1      
          7        SEND_VAR                                                 $1
          8        DO_ICALL                                                 
   14     9        INIT_FCALL                                               'var_dump'
         10        INIT_FCALL                                               'in_array'
         11        SEND_VAL                                                 'MauricioTrait'
         12        INIT_FCALL                                               'class_uses'
         13        SEND_VAL                                                 'MauricioClass'
         14        DO_ICALL                                         $3      
         15        SEND_VAR                                                 $3
         16        DO_ICALL                                         $4      
         17        SEND_VAR                                                 $4
         18        DO_ICALL                                                 
         19      > RETURN                                                   1

Class MauricioTrait:
Function sumstuff:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SPXS4
function name:  sumStuff
number of ops:  5
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        ADD                                              ~2      !0, !1
          3      > RETURN                                                   ~2
          4*     > RETURN                                                   null

End of function sumstuff

Function multiplystuff:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SPXS4
function name:  multiplyStuff
number of ops:  5
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        MUL                                              ~2      !0, !1
          3      > RETURN                                                   ~2
          4*     > RETURN                                                   null

End of function multiplystuff

End of class MauricioTrait.

Class MauricioClass:
Function printstuff:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SPXS4
function name:  printStuff
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E > > RETURN                                                   'Hello+world%21'
          1*     > RETURN                                                   null

End of function printstuff

End of class MauricioClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.84 ms | 1400 KiB | 21 Q