3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo isOnlyThe5thCharacterDifferent("ABCD1EFG","ABCD1EFG")?"TRUE":"FALSE"; // FALSE echo isOnlyThe5thCharacterDifferent("ABCD1EFG","ABCD1EFGGGGG")?"TRUE":"FALSE"; // FALSE echo isOnlyThe5thCharacterDifferent("ABCD1EFG","ABCD2EFG")?"TRUE":"FALSE"; // TRUE function isOnlyThe5thCharacterDifferent($inp1,$inp2) { if ($inp1[4]!=$inp2[4]) { $inp1[4]=$inp2[4]; return ($inp1==$inp2); } return false; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 7
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 16
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
2 jumps found. (Code = 43) Position 1 = 23, Position 2 = 25
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 23, Position 2 = 25
Branch analysis from position: 23
Branch analysis from position: 25
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 16
Branch analysis from position: 14
Branch analysis from position: 16
filename:       /in/fn2sG
function name:  (null)
number of ops:  28
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   INIT_FCALL_BY_NAME                                       'isOnlyThe5thCharacterDifferent'
          1        SEND_VAL_EX                                              'ABCD1EFG'
          2        SEND_VAL_EX                                              'ABCD1EFG'
          3        DO_FCALL                                      0  $0      
          4      > JMPZ                                                     $0, ->7
          5    >   QM_ASSIGN                                        ~1      'TRUE'
          6      > JMP                                                      ->8
          7    >   QM_ASSIGN                                        ~1      'FALSE'
          8    >   ECHO                                                     ~1
    6     9        INIT_FCALL_BY_NAME                                       'isOnlyThe5thCharacterDifferent'
         10        SEND_VAL_EX                                              'ABCD1EFG'
         11        SEND_VAL_EX                                              'ABCD1EFGGGGG'
         12        DO_FCALL                                      0  $2      
         13      > JMPZ                                                     $2, ->16
         14    >   QM_ASSIGN                                        ~3      'TRUE'
         15      > JMP                                                      ->17
         16    >   QM_ASSIGN                                        ~3      'FALSE'
         17    >   ECHO                                                     ~3
    8    18        INIT_FCALL_BY_NAME                                       'isOnlyThe5thCharacterDifferent'
         19        SEND_VAL_EX                                              'ABCD1EFG'
         20        SEND_VAL_EX                                              'ABCD2EFG'
         21        DO_FCALL                                      0  $4      
         22      > JMPZ                                                     $4, ->25
         23    >   QM_ASSIGN                                        ~5      'TRUE'
         24      > JMP                                                      ->26
         25    >   QM_ASSIGN                                        ~5      'FALSE'
         26    >   ECHO                                                     ~5
   22    27      > RETURN                                                   1

Function isonlythe5thcharacterdifferent:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 11
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fn2sG
function name:  isOnlyThe5thCharacterDifferent
number of ops:  13
compiled vars:  !0 = $inp1, !1 = $inp2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   14     2        FETCH_DIM_R                                      ~2      !0, 4
          3        FETCH_DIM_R                                      ~3      !1, 4
          4        IS_NOT_EQUAL                                             ~2, ~3
          5      > JMPZ                                                     ~4, ->11
   16     6    >   FETCH_DIM_R                                      ~6      !1, 4
          7        ASSIGN_DIM                                               !0, 4
          8        OP_DATA                                                  ~6
   18     9        IS_EQUAL                                         ~7      !0, !1
         10      > RETURN                                                   ~7
   21    11    > > RETURN                                                   <false>
   22    12*     > RETURN                                                   null

End of function isonlythe5thcharacterdifferent

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
135.16 ms | 1000 KiB | 13 Q