3v4l.org

run code in 300+ PHP versions simultaneously
<?php class dyncall { public function __call( $name, $args ) { return $args[0]; } } class declaredcall { public function call( $value ) { return $value; } } $results = array(); $instance = new dyncall(); $start = microtime(true); for ($i = 0; $i < 100000; $i++) { $results[] = $instance->call('foo'); } $end = microtime(true); var_dump($end - $start); $results = array(); $instance = new declaredcall(); $start = microtime(true); for ($i = 0; $i < 100000; $i++) { $results[] = $instance->call('foo'); } $end = microtime(true); var_dump($end - $start);
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 = 10
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 42
Branch analysis from position: 42
2 jumps found. (Code = 44) Position 1 = 44, Position 2 = 36
Branch analysis from position: 44
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 36
2 jumps found. (Code = 44) Position 1 = 44, Position 2 = 36
Branch analysis from position: 44
Branch analysis from position: 36
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 10
Branch analysis from position: 18
Branch analysis from position: 10
filename:       /in/4EJnP
function name:  (null)
number of ops:  53
compiled vars:  !0 = $results, !1 = $instance, !2 = $start, !3 = $i, !4 = $end
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   ASSIGN                                                   !0, <array>
    9     1        NEW                                              $6      'dyncall'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $6
   10     4        INIT_FCALL                                               'microtime'
          5        SEND_VAL                                                 <true>
          6        DO_ICALL                                         $9      
          7        ASSIGN                                                   !2, $9
   11     8        ASSIGN                                                   !3, 0
          9      > JMP                                                      ->16
   12    10    >   INIT_METHOD_CALL                                         !1, 'call'
         11        SEND_VAL_EX                                              'foo'
         12        DO_FCALL                                      0  $13     
         13        ASSIGN_DIM                                               !0
         14        OP_DATA                                                  $13
   11    15        PRE_INC                                                  !3
         16    >   IS_SMALLER                                               !3, 100000
         17      > JMPNZ                                                    ~15, ->10
   14    18    >   INIT_FCALL                                               'microtime'
         19        SEND_VAL                                                 <true>
         20        DO_ICALL                                         $16     
         21        ASSIGN                                                   !4, $16
   15    22        INIT_FCALL                                               'var_dump'
         23        SUB                                              ~18     !4, !2
         24        SEND_VAL                                                 ~18
         25        DO_ICALL                                                 
   17    26        ASSIGN                                                   !0, <array>
   18    27        NEW                                              $21     'declaredcall'
         28        DO_FCALL                                      0          
         29        ASSIGN                                                   !1, $21
   19    30        INIT_FCALL                                               'microtime'
         31        SEND_VAL                                                 <true>
         32        DO_ICALL                                         $24     
         33        ASSIGN                                                   !2, $24
   20    34        ASSIGN                                                   !3, 0
         35      > JMP                                                      ->42
   21    36    >   INIT_METHOD_CALL                                         !1, 'call'
         37        SEND_VAL_EX                                              'foo'
         38        DO_FCALL                                      0  $28     
         39        ASSIGN_DIM                                               !0
         40        OP_DATA                                                  $28
   20    41        PRE_INC                                                  !3
         42    >   IS_SMALLER                                               !3, 100000
         43      > JMPNZ                                                    ~30, ->36
   23    44    >   INIT_FCALL                                               'microtime'
         45        SEND_VAL                                                 <true>
         46        DO_ICALL                                         $31     
         47        ASSIGN                                                   !4, $31
   24    48        INIT_FCALL                                               'var_dump'
         49        SUB                                              ~33     !4, !2
         50        SEND_VAL                                                 ~33
         51        DO_ICALL                                                 
         52      > RETURN                                                   1

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

End of function __call

End of class dyncall.

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

End of function call

End of class declaredcall.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.63 ms | 1400 KiB | 17 Q