3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test_sinted( string $val, string $val2 ) { return $val; } function test_hinted( string $val, $val2 ) { return $val; } function test_ninted( $val, $val2 ) { return $val; } /* "prime" */ test_sinted( 'hello', 'world' ); test_hinted( 'hello', 'world' ); test_ninted( 'hello', 'world' ); $t = microtime( true ); for( $i = 0; ++$i < 1e7; ) test_sinted( 'hello', 'world' ); echo number_format( ( microtime( true ) - $t ) * 1, 5 ), 's', PHP_EOL; $t = microtime( true ); for( $i = 0; ++$i < 1e7; ) test_hinted( 'hello', 'world' ); echo number_format( ( microtime( true ) - $t ) * 1, 5 ), 's', PHP_EOL; $t = microtime( true ); for( $i = 0; ++$i < 1e7; ) test_ninted( 'hello', 'world' ); echo number_format( ( microtime( true ) - $t ) * 1, 5 ), 's', PHP_EOL;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
2 jumps found. (Code = 44) Position 1 = 25, Position 2 = 18
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 47
Branch analysis from position: 47
2 jumps found. (Code = 44) Position 1 = 50, Position 2 = 43
Branch analysis from position: 50
1 jumps found. (Code = 42) Position 1 = 72
Branch analysis from position: 72
2 jumps found. (Code = 44) Position 1 = 75, Position 2 = 68
Branch analysis from position: 75
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 68
2 jumps found. (Code = 44) Position 1 = 75, Position 2 = 68
Branch analysis from position: 75
Branch analysis from position: 68
Branch analysis from position: 43
2 jumps found. (Code = 44) Position 1 = 50, Position 2 = 43
Branch analysis from position: 50
Branch analysis from position: 43
Branch analysis from position: 18
2 jumps found. (Code = 44) Position 1 = 25, Position 2 = 18
Branch analysis from position: 25
Branch analysis from position: 18
filename:       /in/JVmbv
function name:  (null)
number of ops:  88
compiled vars:  !0 = $t, !1 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   INIT_FCALL                                               'test_sinted'
          1        SEND_VAL                                                 'hello'
          2        SEND_VAL                                                 'world'
          3        DO_FCALL                                      0          
   17     4        INIT_FCALL                                               'test_hinted'
          5        SEND_VAL                                                 'hello'
          6        SEND_VAL                                                 'world'
          7        DO_FCALL                                      0          
   18     8        INIT_FCALL                                               'test_ninted'
          9        SEND_VAL                                                 'hello'
         10        SEND_VAL                                                 'world'
         11        DO_FCALL                                      0          
   20    12        INIT_FCALL                                               'microtime'
         13        SEND_VAL                                                 <true>
         14        DO_ICALL                                         $5      
         15        ASSIGN                                                   !0, $5
   21    16        ASSIGN                                                   !1, 0
         17      > JMP                                                      ->22
   22    18    >   INIT_FCALL                                               'test_sinted'
         19        SEND_VAL                                                 'hello'
         20        SEND_VAL                                                 'world'
         21        DO_FCALL                                      0          
   21    22    >   PRE_INC                                          ~9      !1
         23        IS_SMALLER                                               ~9, 1.0e+7
         24      > JMPNZ                                                    ~10, ->18
   23    25    >   INIT_FCALL                                               'number_format'
         26        INIT_FCALL                                               'microtime'
         27        SEND_VAL                                                 <true>
         28        DO_ICALL                                         $11     
         29        SUB                                              ~12     $11, !0
         30        MUL                                              ~13     ~12, 1
         31        SEND_VAL                                                 ~13
         32        SEND_VAL                                                 5
         33        DO_ICALL                                         $14     
         34        ECHO                                                     $14
         35        ECHO                                                     's'
         36        ECHO                                                     '%0A'
   25    37        INIT_FCALL                                               'microtime'
         38        SEND_VAL                                                 <true>
         39        DO_ICALL                                         $15     
         40        ASSIGN                                                   !0, $15
   26    41        ASSIGN                                                   !1, 0
         42      > JMP                                                      ->47
   27    43    >   INIT_FCALL                                               'test_hinted'
         44        SEND_VAL                                                 'hello'
         45        SEND_VAL                                                 'world'
         46        DO_FCALL                                      0          
   26    47    >   PRE_INC                                          ~19     !1
         48        IS_SMALLER                                               ~19, 1.0e+7
         49      > JMPNZ                                                    ~20, ->43
   28    50    >   INIT_FCALL                                               'number_format'
         51        INIT_FCALL                                               'microtime'
         52        SEND_VAL                                                 <true>
         53        DO_ICALL                                         $21     
         54        SUB                                              ~22     $21, !0
         55        MUL                                              ~23     ~22, 1
         56        SEND_VAL                                                 ~23
         57        SEND_VAL                                                 5
         58        DO_ICALL                                         $24     
         59        ECHO                                                     $24
         60        ECHO                                                     's'
         61        ECHO                                                     '%0A'
   30    62        INIT_FCALL                                               'microtime'
         63        SEND_VAL                                                 <true>
         64        DO_ICALL                                         $25     
         65        ASSIGN                                                   !0, $25
   31    66        ASSIGN                                                   !1, 0
         67      > JMP                                                      ->72
   32    68    >   INIT_FCALL                                               'test_ninted'
         69        SEND_VAL                                                 'hello'
         70        SEND_VAL                                                 'world'
         71        DO_FCALL                                      0          
   31    72    >   PRE_INC                                          ~29     !1
         73        IS_SMALLER                                               ~29, 1.0e+7
         74      > JMPNZ                                                    ~30, ->68
   33    75    >   INIT_FCALL                                               'number_format'
         76        INIT_FCALL                                               'microtime'
         77        SEND_VAL                                                 <true>
         78        DO_ICALL                                         $31     
         79        SUB                                              ~32     $31, !0
         80        MUL                                              ~33     ~32, 1
         81        SEND_VAL                                                 ~33
         82        SEND_VAL                                                 5
         83        DO_ICALL                                         $34     
         84        ECHO                                                     $34
         85        ECHO                                                     's'
         86        ECHO                                                     '%0A'
   34    87      > RETURN                                                   1

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

End of function test_sinted

Function test_hinted:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JVmbv
function name:  test_hinted
number of ops:  4
compiled vars:  !0 = $val, !1 = $val2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    8     2      > RETURN                                                   !0
    9     3*     > RETURN                                                   null

End of function test_hinted

Function test_ninted:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JVmbv
function name:  test_ninted
number of ops:  4
compiled vars:  !0 = $val, !1 = $val2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   12     2      > RETURN                                                   !0
   13     3*     > RETURN                                                   null

End of function test_ninted

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
130.53 ms | 1472 KiB | 21 Q