3v4l.org

run code in 300+ PHP versions simultaneously
<?php //Case 1: $DatabaseName = "Jardine Lloyd Thompson"; $BankName = "Thoapson Jordine Llayd"; $data = explode(" ", $DatabaseName); $bank = explode(" ", $BankName); sort($data); sort($bank); if($data == $bank){ echo "true"; exit; // No need to do levenshtein } $lev = 0; foreach($data as $key => $name){ $lev += levenshtein($name, $bank[$key]); } echo PHP_EOL . $lev;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 22
Branch analysis from position: 20
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 22
2 jumps found. (Code = 77) Position 1 = 24, Position 2 = 33
Branch analysis from position: 24
2 jumps found. (Code = 78) Position 1 = 25, Position 2 = 33
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
Branch analysis from position: 33
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 33
filename:       /in/RJSiB
function name:  (null)
number of ops:  37
compiled vars:  !0 = $DatabaseName, !1 = $BankName, !2 = $data, !3 = $bank, !4 = $lev, !5 = $name, !6 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, 'Jardine+Lloyd+Thompson'
    5     1        ASSIGN                                                   !1, 'Thoapson+Jordine+Llayd'
    7     2        INIT_FCALL                                               'explode'
          3        SEND_VAL                                                 '+'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $9      
          6        ASSIGN                                                   !2, $9
    8     7        INIT_FCALL                                               'explode'
          8        SEND_VAL                                                 '+'
          9        SEND_VAR                                                 !1
         10        DO_ICALL                                         $11     
         11        ASSIGN                                                   !3, $11
    9    12        INIT_FCALL                                               'sort'
         13        SEND_REF                                                 !2
         14        DO_ICALL                                                 
   10    15        INIT_FCALL                                               'sort'
         16        SEND_REF                                                 !3
         17        DO_ICALL                                                 
   11    18        IS_EQUAL                                                 !2, !3
         19      > JMPZ                                                     ~15, ->22
   12    20    >   ECHO                                                     'true'
   13    21      > EXIT                                                     
   17    22    >   ASSIGN                                                   !4, 0
   18    23      > FE_RESET_R                                       $17     !2, ->33
         24    > > FE_FETCH_R                                       ~18     $17, !5, ->33
         25    >   ASSIGN                                                   !6, ~18
   19    26        INIT_FCALL                                               'levenshtein'
         27        SEND_VAR                                                 !5
         28        FETCH_DIM_R                                      ~20     !3, !6
         29        SEND_VAL                                                 ~20
         30        DO_ICALL                                         $21     
         31        ASSIGN_OP                                     1          !4, $21
   18    32      > JMP                                                      ->24
         33    >   FE_FREE                                                  $17
   22    34        CONCAT                                           ~23     '%0A', !4
         35        ECHO                                                     ~23
   23    36      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
137.62 ms | 1001 KiB | 16 Q