3v4l.org

run code in 300+ PHP versions simultaneously
<?php $scrambled_word = "rerimafa;eorzdsntictaimoa;sgiytihe;rleadf;opflpy;imtadx;ynivdiit;owdes;etylvroc;rasomr"; function asciiSum($word) { $characters = str_split(strtolower($word)); $sum = 0; foreach($characters as $character) { $sum += ord($character); } return $sum; } function alphWord($word) { $alphWord = str_split($word); sort($alphWord); $alphWord = implode('', $alphWord); return $alphWord; } $scrambled_word = explode(";", $scrambled_word); $words = explode("\n", file_get_contents('dictionary.txt')); $password = ''; for ($x = 0; $x <= 9; $x++) { foreach ($words as $word) { if (strlen($scrambled_word[$x]) === strlen($word)) { // Same lenght? if(asciiSum($scrambled_word[$x]) == asciiSum($word)) { // Same ascii score? if(alphWord($scrambled_word[$x]) == alphWord($word)) { // Same word after alph order? $password .= $word.';'; break; } } } } } echo substr($password, 0, -1); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 48
Branch analysis from position: 48
2 jumps found. (Code = 44) Position 1 = 50, Position 2 = 17
Branch analysis from position: 50
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
2 jumps found. (Code = 77) Position 1 = 18, Position 2 = 46
Branch analysis from position: 18
2 jumps found. (Code = 78) Position 1 = 19, Position 2 = 46
Branch analysis from position: 19
2 jumps found. (Code = 43) Position 1 = 24, Position 2 = 45
Branch analysis from position: 24
2 jumps found. (Code = 43) Position 1 = 33, Position 2 = 45
Branch analysis from position: 33
2 jumps found. (Code = 43) Position 1 = 42, Position 2 = 45
Branch analysis from position: 42
1 jumps found. (Code = 42) Position 1 = 46
Branch analysis from position: 46
2 jumps found. (Code = 44) Position 1 = 50, Position 2 = 17
Branch analysis from position: 50
Branch analysis from position: 17
Branch analysis from position: 45
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
Branch analysis from position: 45
Branch analysis from position: 45
Branch analysis from position: 46
Branch analysis from position: 46
filename:       /in/B85Nk
function name:  (null)
number of ops:  57
compiled vars:  !0 = $scrambled_word, !1 = $words, !2 = $password, !3 = $x, !4 = $word
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'rerimafa%3Beorzdsntictaimoa%3Bsgiytihe%3Brleadf%3Bopflpy%3Bimtadx%3Bynivdiit%3Bowdes%3Betylvroc%3Brasomr'
   21     1        INIT_FCALL                                               'explode'
          2        SEND_VAL                                                 '%3B'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $6      
          5        ASSIGN                                                   !0, $6
   22     6        INIT_FCALL                                               'explode'
          7        SEND_VAL                                                 '%0A'
          8        INIT_FCALL                                               'file_get_contents'
          9        SEND_VAL                                                 'dictionary.txt'
         10        DO_ICALL                                         $8      
         11        SEND_VAR                                                 $8
         12        DO_ICALL                                         $9      
         13        ASSIGN                                                   !1, $9
   23    14        ASSIGN                                                   !2, ''
   25    15        ASSIGN                                                   !3, 0
         16      > JMP                                                      ->48
   26    17    > > FE_RESET_R                                       $13     !1, ->46
         18    > > FE_FETCH_R                                               $13, !4, ->46
   27    19    >   FETCH_DIM_R                                      ~14     !0, !3
         20        STRLEN                                           ~15     ~14
         21        STRLEN                                           ~16     !4
         22        IS_IDENTICAL                                             ~15, ~16
         23      > JMPZ                                                     ~17, ->45
   28    24    >   INIT_FCALL                                               'asciisum'
         25        FETCH_DIM_R                                      ~18     !0, !3
         26        SEND_VAL                                                 ~18
         27        DO_FCALL                                      0  $19     
         28        INIT_FCALL                                               'asciisum'
         29        SEND_VAR                                                 !4
         30        DO_FCALL                                      0  $20     
         31        IS_EQUAL                                                 $19, $20
         32      > JMPZ                                                     ~21, ->45
   29    33    >   INIT_FCALL                                               'alphword'
         34        FETCH_DIM_R                                      ~22     !0, !3
         35        SEND_VAL                                                 ~22
         36        DO_FCALL                                      0  $23     
         37        INIT_FCALL                                               'alphword'
         38        SEND_VAR                                                 !4
         39        DO_FCALL                                      0  $24     
         40        IS_EQUAL                                                 $23, $24
         41      > JMPZ                                                     ~25, ->45
   30    42    >   CONCAT                                           ~26     !4, '%3B'
         43        ASSIGN_OP                                     8          !2, ~26
   31    44      > JMP                                                      ->46
   26    45    > > JMP                                                      ->18
         46    >   FE_FREE                                                  $13
   25    47        PRE_INC                                                  !3
         48    >   IS_SMALLER_OR_EQUAL                                      !3, 9
         49      > JMPNZ                                                    ~29, ->17
   38    50    >   INIT_FCALL                                               'substr'
         51        SEND_VAR                                                 !2
         52        SEND_VAL                                                 0
         53        SEND_VAL                                                 -1
         54        DO_ICALL                                         $30     
         55        ECHO                                                     $30
   40    56      > RETURN                                                   1

Function asciisum:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 10, Position 2 = 16
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 16
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
filename:       /in/B85Nk
function name:  asciiSum
number of ops:  19
compiled vars:  !0 = $word, !1 = $characters, !2 = $sum, !3 = $character
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    6     1        INIT_FCALL                                               'str_split'
          2        INIT_FCALL                                               'strtolower'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $4      
          5        SEND_VAR                                                 $4
          6        DO_ICALL                                         $5      
          7        ASSIGN                                                   !1, $5
    7     8        ASSIGN                                                   !2, 0
    8     9      > FE_RESET_R                                       $8      !1, ->16
         10    > > FE_FETCH_R                                               $8, !3, ->16
    9    11    >   INIT_FCALL                                               'ord'
         12        SEND_VAR                                                 !3
         13        DO_ICALL                                         $9      
         14        ASSIGN_OP                                     1          !2, $9
    8    15      > JMP                                                      ->10
         16    >   FE_FREE                                                  $8
   11    17      > RETURN                                                   !2
   12    18*     > RETURN                                                   null

End of function asciisum

Function alphword:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/B85Nk
function name:  alphWord
number of ops:  15
compiled vars:  !0 = $word, !1 = $alphWord
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
   15     1        INIT_FCALL                                               'str_split'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $2      
          4        ASSIGN                                                   !1, $2
   16     5        INIT_FCALL                                               'sort'
          6        SEND_REF                                                 !1
          7        DO_ICALL                                                 
   17     8        INIT_FCALL                                               'implode'
          9        SEND_VAL                                                 ''
         10        SEND_VAR                                                 !1
         11        DO_ICALL                                         $5      
         12        ASSIGN                                                   !1, $5
   18    13      > RETURN                                                   !1
   19    14*     > RETURN                                                   null

End of function alphword

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.29 ms | 1406 KiB | 33 Q