3v4l.org

run code in 300+ PHP versions simultaneously
<?php $v1 = 5; $v2 = '5-4'; $time = microtime(1); $i = 0; while($i++ < 1000000) donull((strcmp($v1,$v2) === 0)); echo (microtime(1)-$time)." seconds for strcmp"; echo "\n"; $time = microtime(1); $i = 0; while($i++ < 1000000) donull(((string) $v1 == (string) $v2)); echo (microtime(1)-$time)." seconds for typecasting"; function donull($v){};
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 = 19, Position 2 = 8
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 38
Branch analysis from position: 38
2 jumps found. (Code = 44) Position 1 = 41, Position 2 = 32
Branch analysis from position: 41
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 32
2 jumps found. (Code = 44) Position 1 = 41, Position 2 = 32
Branch analysis from position: 41
Branch analysis from position: 32
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 19, Position 2 = 8
Branch analysis from position: 19
Branch analysis from position: 8
filename:       /in/gsu8c
function name:  (null)
number of ops:  48
compiled vars:  !0 = $v1, !1 = $v2, !2 = $time, !3 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 5
    3     1        ASSIGN                                                   !1, '5-4'
    5     2        INIT_FCALL                                               'microtime'
          3        SEND_VAL                                                 1
          4        DO_ICALL                                         $6      
          5        ASSIGN                                                   !2, $6
    6     6        ASSIGN                                                   !3, 0
    7     7      > JMP                                                      ->16
          8    >   INIT_FCALL_BY_NAME                                       'donull'
          9        INIT_FCALL                                               'strcmp'
         10        SEND_VAR                                                 !0
         11        SEND_VAR                                                 !1
         12        DO_ICALL                                         $9      
         13        IS_IDENTICAL                                     ~10     $9, 0
         14        SEND_VAL_EX                                              ~10
         15        DO_FCALL                                      0          
         16    >   POST_INC                                         ~12     !3
         17        IS_SMALLER                                               ~12, 1000000
         18      > JMPNZ                                                    ~13, ->8
    8    19    >   INIT_FCALL                                               'microtime'
         20        SEND_VAL                                                 1
         21        DO_ICALL                                         $14     
         22        SUB                                              ~15     $14, !2
         23        CONCAT                                           ~16     ~15, '+seconds+for+strcmp'
         24        ECHO                                                     ~16
   10    25        ECHO                                                     '%0A'
   13    26        INIT_FCALL                                               'microtime'
         27        SEND_VAL                                                 1
         28        DO_ICALL                                         $17     
         29        ASSIGN                                                   !2, $17
   14    30        ASSIGN                                                   !3, 0
   15    31      > JMP                                                      ->38
         32    >   INIT_FCALL_BY_NAME                                       'donull'
         33        CAST                                          6  ~20     !0
         34        CAST                                          6  ~21     !1
         35        IS_EQUAL                                         ~22     ~20, ~21
         36        SEND_VAL_EX                                              ~22
         37        DO_FCALL                                      0          
         38    >   POST_INC                                         ~24     !3
         39        IS_SMALLER                                               ~24, 1000000
         40      > JMPNZ                                                    ~25, ->32
   16    41    >   INIT_FCALL                                               'microtime'
         42        SEND_VAL                                                 1
         43        DO_ICALL                                         $26     
         44        SUB                                              ~27     $26, !2
         45        CONCAT                                           ~28     ~27, '+seconds+for+typecasting'
         46        ECHO                                                     ~28
   18    47      > RETURN                                                   1

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

End of function donull

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.36 ms | 1400 KiB | 17 Q