3v4l.org

run code in 300+ PHP versions simultaneously
<?php //$lines=file('your.txt'); $lines=[ 'a:849444988- b:10.0', 'a:748449844- b:15.0', 'a:123456789- b:120.0', 'a:940849847- b:20.0', 'a:474844994- b:55.0' ]; usort($lines,function($a,$b){ return strnatcmp( substr($b,strpos($b,'b:')+2) , substr($a,strpos($a,'b:')+2) ); }); echo implode("\n",$lines);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ah9jA
function name:  (null)
number of ops:  12
compiled vars:  !0 = $lines
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   11     1        INIT_FCALL                                               'usort'
          2        SEND_REF                                                 !0
          3        DECLARE_LAMBDA_FUNCTION                          ~2      [0]
   13     4        SEND_VAL                                                 ~2
   11     5        DO_ICALL                                                 
   15     6        INIT_FCALL                                               'implode'
          7        SEND_VAL                                                 '%0A'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                         $4      
         10        ECHO                                                     $4
         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/ah9jA
function name:  {closure}
number of ops:  26
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   12     2        INIT_FCALL                                               'strnatcmp'
          3        INIT_FCALL                                               'substr'
          4        SEND_VAR                                                 !1
          5        INIT_FCALL                                               'strpos'
          6        SEND_VAR                                                 !1
          7        SEND_VAL                                                 'b%3A'
          8        DO_ICALL                                         $2      
          9        ADD                                              ~3      $2, 2
         10        SEND_VAL                                                 ~3
         11        DO_ICALL                                         $4      
         12        SEND_VAR                                                 $4
         13        INIT_FCALL                                               'substr'
         14        SEND_VAR                                                 !0
         15        INIT_FCALL                                               'strpos'
         16        SEND_VAR                                                 !0
         17        SEND_VAL                                                 'b%3A'
         18        DO_ICALL                                         $5      
         19        ADD                                              ~6      $5, 2
         20        SEND_VAL                                                 ~6
         21        DO_ICALL                                         $7      
         22        SEND_VAR                                                 $7
         23        DO_ICALL                                         $8      
         24      > RETURN                                                   $8
   13    25*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.22 ms | 1016 KiB | 18 Q