3v4l.org

run code in 500+ PHP versions simultaneously
<?php $testStrings = [ "H3||0", "Hallo", "aloha", "h", "hallo", "hallå", "hel", "helicopter", "hellacious", "hello", "hello y'all", "hello yall", "helów", "hey hello", "hola", "hêllo", "mellow yellow", "try", ]; $needle = 'hello'; usort($testStrings, function($a, $b) use ($needle) { return levenshtein($needle, $a) <=> levenshtein($needle, $b); }); var_export($testStrings);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ELPca
function name:  (null)
number of ops:  12
compiled vars:  !0 = $testStrings, !1 = $needle
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
   24     1        ASSIGN                                                       !1, 'hello'
   26     2        INIT_FCALL                                                   'usort'
          3        SEND_REF                                                     !0
          4        DECLARE_LAMBDA_FUNCTION                              ~4      [0]
          5        BIND_LEXICAL                                                 ~4, !1
   28     6        SEND_VAL                                                     ~4
   26     7        DO_ICALL                                                     
   29     8        INIT_FCALL                                                   'var_export'
          9        SEND_VAR                                                     !0
         10        DO_ICALL                                                     
         11      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ELPca
function name:  {closure:/in/ELPca:26}
number of ops:  14
compiled vars:  !0 = $a, !1 = $b, !2 = $needle
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   26     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
          2        BIND_STATIC                                                  !2
   27     3        INIT_FCALL                                                   'levenshtein'
          4        SEND_VAR                                                     !2
          5        SEND_VAR                                                     !0
          6        DO_ICALL                                             $3      
          7        INIT_FCALL                                                   'levenshtein'
          8        SEND_VAR                                                     !2
          9        SEND_VAR                                                     !1
         10        DO_ICALL                                             $4      
         11        SPACESHIP                                            ~5      $3, $4
         12      > RETURN                                                       ~5
   28    13*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
172.24 ms | 2248 KiB | 16 Q