3v4l.org

run code in 300+ PHP versions simultaneously
<?php $t1 = hrtime(true); for ($i = 0; $i < 6000000; $i++) { hi1("hi", $i, [], new stdClass(), 0.0, true); } $t2 = hrtime(true); $t3 = hrtime(true); for ($i = 0; $i < 6000000; $i++) { hi2("hi", $i, [], new stdClass(), 0.0, true); } $t4 = hrtime(true); echo "Without types: " . (($t2 - $t1) / 1000000) . " ms\n"; echo "With types : " . (($t4 - $t3) / 1000000) . " ms\n"; /** * @param string $a * @param int $b * @param array $c * @param stdClass $d * @param float $e * @param bool $f * @return void */ function hi1($a, $b, $c, $d, $e, $f) { } function hi2(string $a, int $b, array $c, stdClass $d, float $e, bool $f): void { }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
2 jumps found. (Code = 44) Position 1 = 19, Position 2 = 6
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 40
Branch analysis from position: 40
2 jumps found. (Code = 44) Position 1 = 42, Position 2 = 29
Branch analysis from position: 42
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 29
2 jumps found. (Code = 44) Position 1 = 42, Position 2 = 29
Branch analysis from position: 42
Branch analysis from position: 29
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 19, Position 2 = 6
Branch analysis from position: 19
Branch analysis from position: 6
filename:       /in/2aFg7
function name:  (null)
number of ops:  57
compiled vars:  !0 = $t1, !1 = $i, !2 = $t2, !3 = $t3, !4 = $t4
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'hrtime'
          1        SEND_VAL                                                 <true>
          2        DO_ICALL                                         $5      
          3        ASSIGN                                                   !0, $5
    4     4        ASSIGN                                                   !1, 0
          5      > JMP                                                      ->17
    5     6    >   INIT_FCALL_BY_NAME                                       'hi1'
          7        SEND_VAL_EX                                              'hi'
          8        SEND_VAR_EX                                              !1
          9        SEND_VAL_EX                                              <array>
         10        NEW                                              $8      'stdClass'
         11        DO_FCALL                                      0          
         12        SEND_VAR_NO_REF_EX                                       $8
         13        SEND_VAL_EX                                              0
         14        SEND_VAL_EX                                              <true>
         15        DO_FCALL                                      0          
    4    16        PRE_INC                                                  !1
         17    >   IS_SMALLER                                               !1, 6000000
         18      > JMPNZ                                                    ~12, ->6
    7    19    >   INIT_FCALL                                               'hrtime'
         20        SEND_VAL                                                 <true>
         21        DO_ICALL                                         $13     
         22        ASSIGN                                                   !2, $13
    9    23        INIT_FCALL                                               'hrtime'
         24        SEND_VAL                                                 <true>
         25        DO_ICALL                                         $15     
         26        ASSIGN                                                   !3, $15
   10    27        ASSIGN                                                   !1, 0
         28      > JMP                                                      ->40
   11    29    >   INIT_FCALL_BY_NAME                                       'hi2'
         30        SEND_VAL_EX                                              'hi'
         31        SEND_VAR_EX                                              !1
         32        SEND_VAL_EX                                              <array>
         33        NEW                                              $18     'stdClass'
         34        DO_FCALL                                      0          
         35        SEND_VAR_NO_REF_EX                                       $18
         36        SEND_VAL_EX                                              0
         37        SEND_VAL_EX                                              <true>
         38        DO_FCALL                                      0          
   10    39        PRE_INC                                                  !1
         40    >   IS_SMALLER                                               !1, 6000000
         41      > JMPNZ                                                    ~22, ->29
   13    42    >   INIT_FCALL                                               'hrtime'
         43        SEND_VAL                                                 <true>
         44        DO_ICALL                                         $23     
         45        ASSIGN                                                   !4, $23
   15    46        SUB                                              ~25     !2, !0
         47        DIV                                              ~26     ~25, 1000000
         48        CONCAT                                           ~27     'Without+types%3A+', ~26
         49        CONCAT                                           ~28     ~27, '+ms%0A'
         50        ECHO                                                     ~28
   16    51        SUB                                              ~29     !4, !3
         52        DIV                                              ~30     ~29, 1000000
         53        CONCAT                                           ~31     'With+types+++%3A+', ~30
         54        CONCAT                                           ~32     ~31, '+ms%0A'
         55        ECHO                                                     ~32
   33    56      > RETURN                                                   1

Function hi1:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2aFg7
function name:  hi1
number of ops:  7
compiled vars:  !0 = $a, !1 = $b, !2 = $c, !3 = $d, !4 = $e, !5 = $f
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV                                             !3      
          4        RECV                                             !4      
          5        RECV                                             !5      
   29     6      > RETURN                                                   null

End of function hi1

Function hi2:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2aFg7
function name:  hi2
number of ops:  7
compiled vars:  !0 = $a, !1 = $b, !2 = $c, !3 = $d, !4 = $e, !5 = $f
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   31     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV                                             !3      
          4        RECV                                             !4      
          5        RECV                                             !5      
   33     6      > RETURN                                                   null

End of function hi2

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
135.04 ms | 1441 KiB | 14 Q