3v4l.org

run code in 300+ PHP versions simultaneously
<?php class foo { public function bar($x,$y){ return $x*y; } } $s = microtime(true); $foo = new foo(); for($x = 0; $x < 10000; $x++ ){ call_user_func(array($foo, 'bar'), 10,20); } echo round(microtime(true) - $s,5)."\n"; $s = microtime(true); $foo = new foo(); $met = 'bar'; for($x = 0; $x < 10000; $x++ ){ $foo->$bar(10,20); } echo round(microtime(true) - $s,5)."\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 9
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 43
Branch analysis from position: 43
2 jumps found. (Code = 44) Position 1 = 45, Position 2 = 38
Branch analysis from position: 45
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 38
2 jumps found. (Code = 44) Position 1 = 45, Position 2 = 38
Branch analysis from position: 45
Branch analysis from position: 38
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 9
Branch analysis from position: 18
Branch analysis from position: 9
filename:       /in/NWffh
function name:  (null)
number of ops:  56
compiled vars:  !0 = $s, !1 = $foo, !2 = $x, !3 = $met, !4 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   INIT_FCALL                                               'microtime'
          1        SEND_VAL                                                 <true>
          2        DO_ICALL                                         $5      
          3        ASSIGN                                                   !0, $5
   10     4        NEW                                              $7      'foo'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !1, $7
   11     7        ASSIGN                                                   !2, 0
          8      > JMP                                                      ->16
   12     9    >   INIT_ARRAY                                       ~11     !1
         10        ADD_ARRAY_ELEMENT                                ~11     'bar'
         11        INIT_USER_CALL                                2          'call_user_func', ~11
         12        SEND_USER                                                10
         13        SEND_USER                                                20
         14        DO_FCALL                                      0          
   11    15        PRE_INC                                                  !2
         16    >   IS_SMALLER                                               !2, 10000
         17      > JMPNZ                                                    ~14, ->9
   14    18    >   INIT_FCALL                                               'round'
         19        INIT_FCALL                                               'microtime'
         20        SEND_VAL                                                 <true>
         21        DO_ICALL                                         $15     
         22        SUB                                              ~16     $15, !0
         23        SEND_VAL                                                 ~16
         24        SEND_VAL                                                 5
         25        DO_ICALL                                         $17     
         26        CONCAT                                           ~18     $17, '%0A'
         27        ECHO                                                     ~18
   18    28        INIT_FCALL                                               'microtime'
         29        SEND_VAL                                                 <true>
         30        DO_ICALL                                         $19     
         31        ASSIGN                                                   !0, $19
   19    32        NEW                                              $21     'foo'
         33        DO_FCALL                                      0          
         34        ASSIGN                                                   !1, $21
   20    35        ASSIGN                                                   !3, 'bar'
   21    36        ASSIGN                                                   !2, 0
         37      > JMP                                                      ->43
   22    38    >   INIT_METHOD_CALL                                         !1, !4
         39        SEND_VAL_EX                                              10
         40        SEND_VAL_EX                                              20
         41        DO_FCALL                                      0          
   21    42        PRE_INC                                                  !2
         43    >   IS_SMALLER                                               !2, 10000
         44      > JMPNZ                                                    ~28, ->38
   24    45    >   INIT_FCALL                                               'round'
         46        INIT_FCALL                                               'microtime'
         47        SEND_VAL                                                 <true>
         48        DO_ICALL                                         $29     
         49        SUB                                              ~30     $29, !0
         50        SEND_VAL                                                 ~30
         51        SEND_VAL                                                 5
         52        DO_ICALL                                         $31     
         53        CONCAT                                           ~32     $31, '%0A'
         54        ECHO                                                     ~32
         55      > RETURN                                                   1

Class foo:
Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NWffh
function name:  bar
number of ops:  6
compiled vars:  !0 = $x, !1 = $y
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    5     2        FETCH_CONSTANT                                   ~2      'y'
          3        MUL                                              ~3      !0, ~2
          4      > RETURN                                                   ~3
    6     5*     > RETURN                                                   null

End of function bar

End of class foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.34 ms | 1400 KiB | 17 Q