3v4l.org

run code in 500+ PHP versions simultaneously
<?php $test = [ ['id' => 1, 'countries' => 'EN,CH,SP'], ['id' => 2, 'countries' => 'GE,SP,SV'], ['id' => 3, 'countries' => 'PR,SP,IT'], ['id' => 4, 'countries' => 'EN'], ['id' => 5, 'countries' => 'SP,EN'], ['id' => 6, 'countries' => 'SV,SP,EN'], ['id' => 7, 'countries' => 'GE,SP'], ['id' => 8, 'countries' => 'FR'], ['id' => 9, 'countries' => 'RU,EN'], ['id' => 10, 'countries' => 'EN,SP,IT'], ['id' => 11, 'countries' => 'SP,GR'], ['id' => 12, 'countries' => 'GR,EN'] ]; usort($test, function($a, $b) { return [strpos($a['countries'], 'EN') === false, $a['id']] <=> [strpos($b['countries'], 'EN') === false, $b['id']]; }); var_export($test);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GoVhs
function name:  (null)
number of ops:  10
compiled vars:  !0 = $test
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                       !0, <array>
   17     1        INIT_FCALL                                                   'usort'
          2        SEND_REF                                                     !0
          3        DECLARE_LAMBDA_FUNCTION                              ~2      [0]
   19     4        SEND_VAL                                                     ~2
   17     5        DO_ICALL                                                     
   21     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/GoVhs
function name:  {closure:/in/GoVhs:17}
number of ops:  17
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   17     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
   18     2        FETCH_DIM_R                                          ~2      !0, 'countries'
          3        FRAMELESS_ICALL_2                strpos              ~3      ~2, 'EN'
          4        TYPE_CHECK                                        4  ~4      ~3
          5        INIT_ARRAY                                           ~5      ~4
          6        FETCH_DIM_R                                          ~6      !0, 'id'
          7        ADD_ARRAY_ELEMENT                                    ~5      ~6
          8        FETCH_DIM_R                                          ~7      !1, 'countries'
          9        FRAMELESS_ICALL_2                strpos              ~8      ~7, 'EN'
         10        TYPE_CHECK                                        4  ~9      ~8
         11        INIT_ARRAY                                           ~10     ~9
         12        FETCH_DIM_R                                          ~11     !1, 'id'
         13        ADD_ARRAY_ELEMENT                                    ~10     ~11
         14        SPACESHIP                                            ~12     ~5, ~10
         15      > RETURN                                                       ~12
   19    16*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
158.89 ms | 2457 KiB | 15 Q