3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
136.69 ms | 1004 KiB | 15 Q