3v4l.org

run code in 300+ PHP versions simultaneously
<?php $strings[] = 'sixty yards out'; $strings[] = 'seventy five yards out'; $strings[] = 'one hundred fifty yards out'; $inputString = 'seventy two yards out'; $p = 0; $k = null; foreach ($strings as $key => $string) { similar_text($inputString, $string, $percent); if ($percent > $p) { $p = $percent; $k = $key; } } echo $k ? $strings[$k] : "";
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 10, Position 2 = 22
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 22
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 21
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 21
Branch analysis from position: 22
2 jumps found. (Code = 43) Position 1 = 24, Position 2 = 27
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 28
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
filename:       /in/JA0Or
function name:  (null)
number of ops:  30
compiled vars:  !0 = $strings, !1 = $inputString, !2 = $p, !3 = $k, !4 = $string, !5 = $key, !6 = $percent
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN_DIM                                               !0
          1        OP_DATA                                                  'sixty+yards+out'
    4     2        ASSIGN_DIM                                               !0
          3        OP_DATA                                                  'seventy+five+yards+out'
    5     4        ASSIGN_DIM                                               !0
          5        OP_DATA                                                  'one+hundred+fifty+yards+out'
    7     6        ASSIGN                                                   !1, 'seventy+two+yards+out'
    9     7        ASSIGN                                                   !2, 0
   10     8        ASSIGN                                                   !3, null
   11     9      > FE_RESET_R                                       $13     !0, ->22
         10    > > FE_FETCH_R                                       ~14     $13, !4, ->22
         11    >   ASSIGN                                                   !5, ~14
   12    12        INIT_FCALL                                               'similar_text'
         13        SEND_VAR                                                 !1
         14        SEND_VAR                                                 !4
         15        SEND_REF                                                 !6
         16        DO_ICALL                                                 
   13    17        IS_SMALLER                                               !2, !6
         18      > JMPZ                                                     ~17, ->21
   14    19    >   ASSIGN                                                   !2, !6
   15    20        ASSIGN                                                   !3, !5
   11    21    > > JMP                                                      ->10
         22    >   FE_FREE                                                  $13
   19    23      > JMPZ                                                     !3, ->27
         24    >   FETCH_DIM_R                                      ~20     !0, !3
         25        QM_ASSIGN                                        ~21     ~20
         26      > JMP                                                      ->28
         27    >   QM_ASSIGN                                        ~21     ''
         28    >   ECHO                                                     ~21
         29      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.34 ms | 1401 KiB | 15 Q