3v4l.org

run code in 300+ PHP versions simultaneously
<?php function hello(float $a, float $b, float $c, float $d){ return $a+$b+$c+$d; } function hello2($a, $b, $c, $d){ return $a+$b+$c+$d; } function millis(){ return round(microtime(true) * 1000); } $a = array(1,2,3,4,"test"); $t = millis(); for($i=0;$i<500000;$i++){ hello($a[0],$a[1],$a[2],$a[3]); } echo("with types: " . (millis() -$t) . " ms\n"); $t = millis(); for($i=0;$i<500000;$i++){ hello2($a[0],$a[1],$a[2],$a[3]); } echo("without types: " . (millis() -$t) . " ms\n");
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 = 41
Branch analysis from position: 41
2 jumps found. (Code = 44) Position 1 = 43, Position 2 = 30
Branch analysis from position: 43
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 30
2 jumps found. (Code = 44) Position 1 = 43, Position 2 = 30
Branch analysis from position: 43
Branch analysis from position: 30
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/chhCD
function name:  (null)
number of ops:  50
compiled vars:  !0 = $a, !1 = $t, !2 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   ASSIGN                                                   !0, <array>
   16     1        INIT_FCALL                                               'millis'
          2        DO_FCALL                                      0  $4      
          3        ASSIGN                                                   !1, $4
   17     4        ASSIGN                                                   !2, 0
          5      > JMP                                                      ->17
   18     6    >   INIT_FCALL                                               'hello'
          7        FETCH_DIM_R                                      ~7      !0, 0
          8        SEND_VAL                                                 ~7
          9        FETCH_DIM_R                                      ~8      !0, 1
         10        SEND_VAL                                                 ~8
         11        FETCH_DIM_R                                      ~9      !0, 2
         12        SEND_VAL                                                 ~9
         13        FETCH_DIM_R                                      ~10     !0, 3
         14        SEND_VAL                                                 ~10
         15        DO_FCALL                                      0          
   17    16        PRE_INC                                                  !2
         17    >   IS_SMALLER                                               !2, 500000
         18      > JMPNZ                                                    ~13, ->6
   21    19    >   INIT_FCALL                                               'millis'
         20        DO_FCALL                                      0  $14     
         21        SUB                                              ~15     $14, !1
         22        CONCAT                                           ~16     'with+types%3A+', ~15
         23        CONCAT                                           ~17     ~16, '+ms%0A'
         24        ECHO                                                     ~17
   23    25        INIT_FCALL                                               'millis'
         26        DO_FCALL                                      0  $18     
         27        ASSIGN                                                   !1, $18
   24    28        ASSIGN                                                   !2, 0
         29      > JMP                                                      ->41
   25    30    >   INIT_FCALL                                               'hello2'
         31        FETCH_DIM_R                                      ~21     !0, 0
         32        SEND_VAL                                                 ~21
         33        FETCH_DIM_R                                      ~22     !0, 1
         34        SEND_VAL                                                 ~22
         35        FETCH_DIM_R                                      ~23     !0, 2
         36        SEND_VAL                                                 ~23
         37        FETCH_DIM_R                                      ~24     !0, 3
         38        SEND_VAL                                                 ~24
         39        DO_FCALL                                      0          
   24    40        PRE_INC                                                  !2
         41    >   IS_SMALLER                                               !2, 500000
         42      > JMPNZ                                                    ~27, ->30
   28    43    >   INIT_FCALL                                               'millis'
         44        DO_FCALL                                      0  $28     
         45        SUB                                              ~29     $28, !1
         46        CONCAT                                           ~30     'without+types%3A+', ~29
         47        CONCAT                                           ~31     ~30, '+ms%0A'
         48        ECHO                                                     ~31
         49      > RETURN                                                   1

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

End of function hello

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

End of function hello2

Function millis:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/chhCD
function name:  millis
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   INIT_FCALL                                               'round'
          1        INIT_FCALL                                               'microtime'
          2        SEND_VAL                                                 <true>
          3        DO_ICALL                                         $0      
          4        MUL                                              ~1      $0, 1000
          5        SEND_VAL                                                 ~1
          6        DO_ICALL                                         $2      
          7      > RETURN                                                   $2
   13     8*     > RETURN                                                   null

End of function millis

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.57 ms | 1407 KiB | 23 Q