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, fn($a, $b) => levenshtein($needle, $a) <=> levenshtein($needle, $b) ?: similar_text($needle, $b) <=> similar_text($needle, $a) ); var_export($testStrings);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aNuKt
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
   29     6        SEND_VAL                                                     ~4
   26     7        DO_ICALL                                                     
   30     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/aNuKt
function name:  {closure:/in/aNuKt:26}
number of ops:  25
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        JMP_SET                                              ~6      ~5, ->23
   28    13        INIT_FCALL                                                   'similar_text'
         14        SEND_VAR                                                     !2
         15        SEND_VAR                                                     !1
         16        DO_ICALL                                             $7      
         17        INIT_FCALL                                                   'similar_text'
         18        SEND_VAR                                                     !2
         19        SEND_VAR                                                     !0
         20        DO_ICALL                                             $8      
         21        SPACESHIP                                            ~9      $7, $8
         22        QM_ASSIGN                                            ~6      ~9
         23      > RETURN                                                       ~6
   29    24*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
190.29 ms | 2062 KiB | 17 Q