3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr=[['a', 1, 3, 9, 0, 13],['b', 5, 6, 0, 0, 11],['j', 0, 6, 2, 1, 9],['c', 1, 0, 8, 5, 14],['d', 0, 0, 0, 17, 17],['e', 0, 5, 0, 0, 5],['h', 0, 0, 3, 3, 6]]; usort($arr,function($a,$b){ $infoa=array_count_values($a); $infob=array_count_values($b); if(empty($infoa[0])) $infoa[0]=0; if(empty($infob[0])) $infob[0]=0; if($infoa[0]==$infob[0]) { return end($a)-end($b); } else { return $infoa[0]-$infob[0]; } }); print_r($arr);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HGR12
function name:  (null)
number of ops:  10
compiled vars:  !0 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    4     1        INIT_FCALL                                               'usort'
          2        SEND_REF                                                 !0
          3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FHGR12%3A4%240'
   17     4        SEND_VAL                                                 ~2
          5        DO_ICALL                                                 
   19     6        INIT_FCALL                                               'print_r'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                                 
          9      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FHGR12%3A4%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 14
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 18
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 31
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 31
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
Branch analysis from position: 14
filename:       /in/HGR12
function name:  {closure}
number of ops:  36
compiled vars:  !0 = $a, !1 = $b, !2 = $infoa, !3 = $infob
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    5     2        INIT_FCALL                                               'array_count_values'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $4      
          5        ASSIGN                                                   !2, $4
    6     6        INIT_FCALL                                               'array_count_values'
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                         $6      
          9        ASSIGN                                                   !3, $6
    7    10        ISSET_ISEMPTY_DIM_OBJ                         1          !2, 0
         11      > JMPZ                                                     ~8, ->14
         12    >   ASSIGN_DIM                                               !2, 0
         13        OP_DATA                                                  0
    8    14    >   ISSET_ISEMPTY_DIM_OBJ                         1          !3, 0
         15      > JMPZ                                                     ~10, ->18
         16    >   ASSIGN_DIM                                               !3, 0
         17        OP_DATA                                                  0
    9    18    >   FETCH_DIM_R                                      ~12     !2, 0
         19        FETCH_DIM_R                                      ~13     !3, 0
         20        IS_EQUAL                                                 ~12, ~13
         21      > JMPZ                                                     ~14, ->31
   11    22    >   INIT_FCALL                                               'end'
         23        SEND_REF                                                 !0
         24        DO_ICALL                                         $15     
         25        INIT_FCALL                                               'end'
         26        SEND_REF                                                 !1
         27        DO_ICALL                                         $16     
         28        SUB                                              ~17     $15, $16
         29      > RETURN                                                   ~17
         30*       JMP                                                      ->35
   15    31    >   FETCH_DIM_R                                      ~18     !2, 0
         32        FETCH_DIM_R                                      ~19     !3, 0
         33        SUB                                              ~20     ~18, ~19
         34      > RETURN                                                   ~20
   17    35*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FHGR12%3A4%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.4 ms | 1400 KiB | 21 Q