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) { similar_text($needle, $a, $percentA); similar_text($needle, $b, $percentB); return $percentB <=> $percentA; }); var_export($testStrings);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CS7U4
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
   30     6        SEND_VAL                                                     ~4
   26     7        DO_ICALL                                                     
   31     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/CS7U4
function name:  {closure:/in/CS7U4:26}
number of ops:  16
compiled vars:  !0 = $a, !1 = $b, !2 = $needle, !3 = $percentA, !4 = $percentB
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                                                   'similar_text'
          4        SEND_VAR                                                     !2
          5        SEND_VAR                                                     !0
          6        SEND_REF                                                     !3
          7        DO_ICALL                                                     
   28     8        INIT_FCALL                                                   'similar_text'
          9        SEND_VAR                                                     !2
         10        SEND_VAR                                                     !1
         11        SEND_REF                                                     !4
         12        DO_ICALL                                                     
   29    13        SPACESHIP                                            ~7      !4, !3
         14      > RETURN                                                       ~7
   30    15*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
159.89 ms | 2181 KiB | 16 Q