3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ ["id" => 10, "hits" => 80], ["id" => 14, "hits" => 50], ["id" => 15, "hits" => 700], ["id" => 18, "hits" => 200], ]; usort( $array, fn($a, $b) => [$a['id'] !== 18, $a['hits']] <=> [$b['id'] !== 18, $b['hits']] ); var_export($array);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Iu9Cg
function name:  (null)
number of ops:  10
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   10     1        INIT_FCALL                                               'usort'
   11     2        SEND_REF                                                 !0
   12     3        DECLARE_LAMBDA_FUNCTION                          ~2      [0]
   15     4        SEND_VAL                                                 ~2
   10     5        DO_ICALL                                                 
   16     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/Iu9Cg
function name:  {closure}
number of ops:  15
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        FETCH_DIM_R                                      ~2      !0, 'id'
          3        IS_NOT_IDENTICAL                                 ~3      ~2, 18
          4        INIT_ARRAY                                       ~4      ~3
          5        FETCH_DIM_R                                      ~5      !0, 'hits'
          6        ADD_ARRAY_ELEMENT                                ~4      ~5
   14     7        FETCH_DIM_R                                      ~6      !1, 'id'
          8        IS_NOT_IDENTICAL                                 ~7      ~6, 18
          9        INIT_ARRAY                                       ~8      ~7
         10        FETCH_DIM_R                                      ~9      !1, 'hits'
         11        ADD_ARRAY_ELEMENT                                ~8      ~9
         12        SPACESHIP                                        ~10     ~4, ~8
         13      > RETURN                                                   ~10
   15    14*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.94 ms | 1011 KiB | 15 Q