3v4l.org

run code in 300+ PHP versions simultaneously
<?php function slow_equals($a, $b) { $diff = strlen($a) ^ strlen($b); for($i = 0; ($i < strlen($a)) AND ($i < strlen($b)); $i++) { $diff |= ord($a[$i]) ^ ord($b[$i]); } return $diff === 0; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hc7TJ
function name:  (null)
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E > > RETURN                                                   1

Function slow_equals:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
2 jumps found. (Code = 46) Position 1 = 22, Position 2 = 25
Branch analysis from position: 22
2 jumps found. (Code = 44) Position 1 = 26, Position 2 = 8
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
2 jumps found. (Code = 46) Position 1 = 22, Position 2 = 25
Branch analysis from position: 22
Branch analysis from position: 25
Branch analysis from position: 25
filename:       /in/hc7TJ
function name:  slow_equals
number of ops:  29
compiled vars:  !0 = $a, !1 = $b, !2 = $diff, !3 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    5     2        STRLEN                                           ~4      !0
          3        STRLEN                                           ~5      !1
          4        BW_XOR                                           ~6      ~4, ~5
          5        ASSIGN                                                   !2, ~6
    6     6        ASSIGN                                                   !3, 0
          7      > JMP                                                      ->19
    8     8    >   INIT_FCALL                                               'ord'
          9        FETCH_DIM_R                                      ~9      !0, !3
         10        SEND_VAL                                                 ~9
         11        DO_ICALL                                         $10     
         12        INIT_FCALL                                               'ord'
         13        FETCH_DIM_R                                      ~11     !1, !3
         14        SEND_VAL                                                 ~11
         15        DO_ICALL                                         $12     
         16        BW_XOR                                           ~13     $10, $12
         17        ASSIGN_OP                                     9          !2, ~13
    6    18        PRE_INC                                                  !3
         19    >   STRLEN                                           ~16     !0
         20        IS_SMALLER                                       ~17     !3, ~16
         21      > JMPZ_EX                                          ~17     ~17, ->25
         22    >   STRLEN                                           ~18     !1
         23        IS_SMALLER                                       ~19     !3, ~18
         24        BOOL                                             ~17     ~19
         25    > > JMPNZ                                                    ~17, ->8
   10    26    >   IS_IDENTICAL                                     ~20     !2, 0
         27      > RETURN                                                   ~20
   11    28*     > RETURN                                                   null

End of function slow_equals

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.02 ms | 1400 KiB | 15 Q