3v4l.org

run code in 500+ PHP versions simultaneously
<?php $array = ['s', 'h', 'c', 'b', 'a', 'b', 'd', 'e', 'f', 'f', 'g']; $counts = array_count_values($array); $array = array_unique($array); usort($array, fn($a, $b) => $counts[$b] <=> $counts[$a]); var_export($array);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pTHWL
function name:  (null)
number of ops:  19
compiled vars:  !0 = $array, !1 = $counts
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
    5     1        INIT_FCALL                                                   'array_count_values'
          2        SEND_VAR                                                     !0
          3        DO_ICALL                                             $3      
          4        ASSIGN                                                       !1, $3
    6     5        INIT_FCALL                                                   'array_unique'
          6        SEND_VAR                                                     !0
          7        DO_ICALL                                             $5      
          8        ASSIGN                                                       !0, $5
    7     9        INIT_FCALL                                                   'usort'
         10        SEND_REF                                                     !0
         11        DECLARE_LAMBDA_FUNCTION                              ~7      [0]
         12        BIND_LEXICAL                                                 ~7, !1
         13        SEND_VAL                                                     ~7
         14        DO_ICALL                                                     
    8    15        INIT_FCALL                                                   'var_export'
         16        SEND_VAR                                                     !0
         17        DO_ICALL                                                     
         18      > 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/pTHWL
function name:  {closure:/in/pTHWL:7}
number of ops:  8
compiled vars:  !0 = $a, !1 = $b, !2 = $counts
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    7     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
          2        BIND_STATIC                                                  !2
          3        FETCH_DIM_R                                          ~3      !2, !1
          4        FETCH_DIM_R                                          ~4      !2, !0
          5        SPACESHIP                                            ~5      ~3, ~4
          6      > RETURN                                                       ~5
          7*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
162.65 ms | 1642 KiB | 17 Q