3v4l.org

run code in 300+ PHP versions simultaneously
<?php $needle = bin2hex(random_bytes(15)); $shortString = $needle . bin2hex(random_bytes(20)); $longString = bin2hex(random_bytes(500)) . $needle . bin2hex(random_bytes(500)); for ($i = 0; $i < 100000; $i++) { 0 === strncmp($shortString, $needle, strlen($needle)); } for ($i = 0; $i < 100000; $i++) { 0 === strncmp($longString, $needle, strlen($needle)); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 41
Branch analysis from position: 41
2 jumps found. (Code = 44) Position 1 = 43, Position 2 = 32
Branch analysis from position: 43
1 jumps found. (Code = 42) Position 1 = 54
Branch analysis from position: 54
2 jumps found. (Code = 44) Position 1 = 56, Position 2 = 45
Branch analysis from position: 56
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 45
2 jumps found. (Code = 44) Position 1 = 56, Position 2 = 45
Branch analysis from position: 56
Branch analysis from position: 45
Branch analysis from position: 32
2 jumps found. (Code = 44) Position 1 = 43, Position 2 = 32
Branch analysis from position: 43
Branch analysis from position: 32
filename:       /in/bcj88
function name:  (null)
number of ops:  57
compiled vars:  !0 = $needle, !1 = $shortString, !2 = $longString, !3 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'bin2hex'
          1        INIT_FCALL                                               'random_bytes'
          2        SEND_VAL                                                 15
          3        DO_ICALL                                         $4      
          4        SEND_VAR                                                 $4
          5        DO_ICALL                                         $5      
          6        ASSIGN                                                   !0, $5
    4     7        INIT_FCALL                                               'bin2hex'
          8        INIT_FCALL                                               'random_bytes'
          9        SEND_VAL                                                 20
         10        DO_ICALL                                         $7      
         11        SEND_VAR                                                 $7
         12        DO_ICALL                                         $8      
         13        CONCAT                                           ~9      !0, $8
         14        ASSIGN                                                   !1, ~9
    5    15        INIT_FCALL                                               'bin2hex'
         16        INIT_FCALL                                               'random_bytes'
         17        SEND_VAL                                                 500
         18        DO_ICALL                                         $11     
         19        SEND_VAR                                                 $11
         20        DO_ICALL                                         $12     
         21        CONCAT                                           ~13     $12, !0
         22        INIT_FCALL                                               'bin2hex'
         23        INIT_FCALL                                               'random_bytes'
         24        SEND_VAL                                                 500
         25        DO_ICALL                                         $14     
         26        SEND_VAR                                                 $14
         27        DO_ICALL                                         $15     
         28        CONCAT                                           ~16     ~13, $15
         29        ASSIGN                                                   !2, ~16
    7    30        ASSIGN                                                   !3, 0
         31      > JMP                                                      ->41
    8    32    >   INIT_FCALL                                               'strncmp'
         33        SEND_VAR                                                 !1
         34        SEND_VAR                                                 !0
         35        STRLEN                                           ~19     !0
         36        SEND_VAL                                                 ~19
         37        DO_ICALL                                         $20     
         38        IS_IDENTICAL                                     ~21     $20, 0
         39        FREE                                                     ~21
    7    40        PRE_INC                                                  !3
         41    >   IS_SMALLER                                               !3, 100000
         42      > JMPNZ                                                    ~23, ->32
   11    43    >   ASSIGN                                                   !3, 0
         44      > JMP                                                      ->54
   12    45    >   INIT_FCALL                                               'strncmp'
         46        SEND_VAR                                                 !2
         47        SEND_VAR                                                 !0
         48        STRLEN                                           ~25     !0
         49        SEND_VAL                                                 ~25
         50        DO_ICALL                                         $26     
         51        IS_IDENTICAL                                     ~27     $26, 0
         52        FREE                                                     ~27
   11    53        PRE_INC                                                  !3
         54    >   IS_SMALLER                                               !3, 100000
         55      > JMPNZ                                                    ~29, ->45
   13    56    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.47 ms | 1400 KiB | 19 Q