3v4l.org

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

Class foo:
Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/EFP8W
function name:  bar
number of ops:  5
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        MUL                                              ~2      !0, !1
          3      > RETURN                                                   ~2
    6     4*     > RETURN                                                   null

End of function bar

End of class foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.62 ms | 1400 KiB | 17 Q