3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ ["id" => 1, "qt" => 1000, "sa" => 50], ["id" => 2, "qt" => 0, "sa" => 50], ["id" => 3, "qt" => 0, "sa" => 350], ["id" => 4, "qt" => 5000, "sa" => 250], ["id" => 5, "qt" => 10, "sa" => 9000] ]; usort( $array, function($a, $b) { return [$b['qt'] > 0, $b['sa']] <=> [$a['qt'] > 0, $a['sa']]; } ); var_export($array);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZYvnM
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>
   11     1        INIT_FCALL                                               'usort'
   12     2        SEND_REF                                                 !0
   13     3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FZYvnM%3A13%240'
   15     4        SEND_VAL                                                 ~2
          5        DO_ICALL                                                 
   18     6        INIT_FCALL                                               'var_export'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                                 
          9      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FZYvnM%3A13%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZYvnM
function name:  {closure}
number of ops:  15
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   14     2        FETCH_DIM_R                                      ~2      !1, 'qt'
          3        IS_SMALLER                                       ~3      0, ~2
          4        INIT_ARRAY                                       ~4      ~3
          5        FETCH_DIM_R                                      ~5      !1, 'sa'
          6        ADD_ARRAY_ELEMENT                                ~4      ~5
          7        FETCH_DIM_R                                      ~6      !0, 'qt'
          8        IS_SMALLER                                       ~7      0, ~6
          9        INIT_ARRAY                                       ~8      ~7
         10        FETCH_DIM_R                                      ~9      !0, 'sa'
         11        ADD_ARRAY_ELEMENT                                ~8      ~9
         12        SPACESHIP                                        ~10     ~4, ~8
         13      > RETURN                                                   ~10
   15    14*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FZYvnM%3A13%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.45 ms | 1395 KiB | 17 Q