3v4l.org

run code in 300+ PHP versions simultaneously
<?php function compare($left, $right) { if (($length = mb_strlen($left)) != mb_strlen($right)) { return false; } for ($i = 0, $result = 0; $i < $length; $i++) { $result |= ord($left[$i]) ^ ord($right[$i]); } return $result === 0; } var_dump(compare('Ð', 'Â'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vnvpc
function name:  (null)
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'compare'
          2        SEND_VAL                                                 '%C3%90'
          3        SEND_VAL                                                 '%C3%82'
          4        DO_FCALL                                      0  $0      
          5        SEND_VAR                                                 $0
          6        DO_ICALL                                                 
          7      > RETURN                                                   1

Function compare:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 12
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
2 jumps found. (Code = 44) Position 1 = 28, Position 2 = 15
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
2 jumps found. (Code = 44) Position 1 = 28, Position 2 = 15
Branch analysis from position: 28
Branch analysis from position: 15
filename:       /in/vnvpc
function name:  compare
number of ops:  31
compiled vars:  !0 = $left, !1 = $right, !2 = $length, !3 = $i, !4 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    4     2        INIT_FCALL                                               'mb_strlen'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $5      
          5        ASSIGN                                           ~6      !2, $5
          6        INIT_FCALL                                               'mb_strlen'
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                         $7      
          9        IS_NOT_EQUAL                                             $7, ~6
         10      > JMPZ                                                     ~8, ->12
    5    11    > > RETURN                                                   <false>
    7    12    >   ASSIGN                                                   !3, 0
         13        ASSIGN                                                   !4, 0
         14      > JMP                                                      ->26
    8    15    >   INIT_FCALL                                               'ord'
         16        FETCH_DIM_R                                      ~11     !0, !3
         17        SEND_VAL                                                 ~11
         18        DO_ICALL                                         $12     
         19        INIT_FCALL                                               'ord'
         20        FETCH_DIM_R                                      ~13     !1, !3
         21        SEND_VAL                                                 ~13
         22        DO_ICALL                                         $14     
         23        BW_XOR                                           ~15     $12, $14
         24        ASSIGN_OP                                     9          !4, ~15
    7    25        PRE_INC                                                  !3
         26    >   IS_SMALLER                                               !3, !2
         27      > JMPNZ                                                    ~18, ->15
   10    28    >   IS_IDENTICAL                                     ~19     !4, 0
         29      > RETURN                                                   ~19
   11    30*     > RETURN                                                   null

End of function compare

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.33 ms | 1407 KiB | 20 Q