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::{$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 = 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/cIsWZ
function name:  (null)
number of ops:  51
compiled vars:  !0 = $s, !1 = $met, !2 = $x, !3 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   INIT_FCALL                                               'microtime'
          1        SEND_VAL                                                 <true>
          2        DO_ICALL                                         $4      
          3        ASSIGN                                                   !0, $4
   10     4        ASSIGN                                                   !1, 'bar'
   11     5        ASSIGN                                                   !2, 0
          6      > JMP                                                      ->14
   12     7    >   INIT_ARRAY                                       ~8      'foo'
          8        ADD_ARRAY_ELEMENT                                ~8      !1
          9        INIT_USER_CALL                                2          'call_user_func', ~8
         10        SEND_USER                                                10
         11        SEND_USER                                                20
         12        DO_FCALL                                      0          
   11    13        PRE_INC                                                  !2
         14    >   IS_SMALLER                                               !2, 100000
         15      > JMPNZ                                                    ~11, ->7
   14    16    >   INIT_FCALL                                               'round'
         17        INIT_FCALL                                               'microtime'
         18        SEND_VAL                                                 <true>
         19        DO_ICALL                                         $12     
         20        SUB                                              ~13     $12, !0
         21        SEND_VAL                                                 ~13
         22        SEND_VAL                                                 5
         23        DO_ICALL                                         $14     
         24        CONCAT                                           ~15     $14, '%0A'
         25        ECHO                                                     ~15
   18    26        INIT_FCALL                                               'microtime'
         27        SEND_VAL                                                 <true>
         28        DO_ICALL                                         $16     
         29        ASSIGN                                                   !0, $16
   19    30        ASSIGN                                                   !1, 'bar'
   20    31        ASSIGN                                                   !2, 0
         32      > JMP                                                      ->38
   21    33    >   INIT_STATIC_METHOD_CALL                                  'foo', !3
         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                                                    ~22, ->33
   23    40    >   INIT_FCALL                                               'round'
         41        INIT_FCALL                                               'microtime'
         42        SEND_VAL                                                 <true>
         43        DO_ICALL                                         $23     
         44        SUB                                              ~24     $23, !0
         45        SEND_VAL                                                 ~24
         46        SEND_VAL                                                 5
         47        DO_ICALL                                         $25     
         48        CONCAT                                           ~26     $25, '%0A'
         49        ECHO                                                     ~26
         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/cIsWZ
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:
147.19 ms | 1400 KiB | 17 Q