3v4l.org

run code in 300+ 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}
number of ops:  23
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        INIT_FCALL                                               'strpos'
          3        FETCH_DIM_R                                      ~2      !0, 'countries'
          4        SEND_VAL                                                 ~2
          5        SEND_VAL                                                 'EN'
          6        DO_ICALL                                         $3      
          7        TYPE_CHECK                                    4  ~4      $3
          8        INIT_ARRAY                                       ~5      ~4
          9        FETCH_DIM_R                                      ~6      !0, 'id'
         10        ADD_ARRAY_ELEMENT                                ~5      ~6
         11        INIT_FCALL                                               'strpos'
         12        FETCH_DIM_R                                      ~7      !1, 'countries'
         13        SEND_VAL                                                 ~7
         14        SEND_VAL                                                 'EN'
         15        DO_ICALL                                         $8      
         16        TYPE_CHECK                                    4  ~9      $8
         17        INIT_ARRAY                                       ~10     ~9
         18        FETCH_DIM_R                                      ~11     !1, 'id'
         19        ADD_ARRAY_ELEMENT                                ~10     ~11
         20        SPACESHIP                                        ~12     ~5, ~10
         21      > RETURN                                                   ~12
   19    22*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
139.3 ms | 1001 KiB | 16 Q