3v4l.org

run code in 300+ PHP versions simultaneously
<?php $numbers = ['10 Apple', '2 Grapes', '3 Apples', '3.2 Apples', '3.1 Apples', '3.3 Apples', '3.10 Apples', '3.11 Apples', 'Lots of Apples']; usort( $numbers, fn($a, $b) => (sscanf($a, '%f')[0] ?? PHP_INT_MAX) <=> (sscanf($b, '%f')[0] ?? PHP_INT_MAX) ); var_export($numbers);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZsdsB
function name:  (null)
number of ops:  10
compiled vars:  !0 = $numbers
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        INIT_FCALL                                               'usort'
    6     2        SEND_REF                                                 !0
    7     3        DECLARE_LAMBDA_FUNCTION                          ~2      [0]
   10     4        SEND_VAL                                                 ~2
    5     5        DO_ICALL                                                 
   12     6        INIT_FCALL                                               'var_export'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                                 
          9      > 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/ZsdsB
function name:  {closure}
number of ops:  19
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        INIT_FCALL                                               'sscanf'
          3        SEND_VAR                                                 !0
          4        SEND_VAL                                                 '%25f'
          5        DO_ICALL                                         $2      
          6        FETCH_DIM_IS                                     ~3      $2, 0
          7        COALESCE                                         ~4      ~3
          8        QM_ASSIGN                                        ~4      9223372036854775807
    9     9        INIT_FCALL                                               'sscanf'
         10        SEND_VAR                                                 !1
         11        SEND_VAL                                                 '%25f'
         12        DO_ICALL                                         $5      
         13        FETCH_DIM_IS                                     ~6      $5, 0
         14        COALESCE                                         ~7      ~6
         15        QM_ASSIGN                                        ~7      9223372036854775807
         16        SPACESHIP                                        ~8      ~4, ~7
         17      > RETURN                                                   ~8
   10    18*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.1 ms | 1005 KiB | 16 Q