3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ 'a' => 0, 'b' => 0, 'c' => 0, 'd' => 1, 'e' => 1, 'f' => 1 ]; array_multisort( array_map( function ($v) { static $counters = [0, 0]; return $counters[$v]++; }, $array ), $array, SORT_DESC ); var_export($array);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/t8tmU
function name:  (null)
number of ops:  15
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   12     1        INIT_FCALL                                               'array_multisort'
   13     2        INIT_FCALL                                               'array_map'
   14     3        DECLARE_LAMBDA_FUNCTION                          ~2      [0]
   17     4        SEND_VAL                                                 ~2
   18     5        SEND_VAR                                                 !0
   13     6        DO_ICALL                                         $3      
   18     7        SEND_VAL                                                 $3
   20     8        SEND_REF                                                 !0
   21     9        SEND_VAL                                                 3
   12    10        DO_ICALL                                                 
   23    11        INIT_FCALL                                               'var_export'
         12        SEND_VAR                                                 !0
         13        DO_ICALL                                                 
         14      > 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/t8tmU
function name:  {closure}
number of ops:  6
compiled vars:  !0 = $v, !1 = $counters
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
   15     1        BIND_STATIC                                              !1
   16     2        FETCH_DIM_RW                                     $2      !1, !0
          3        POST_INC                                         ~3      $2
          4      > RETURN                                                   ~3
   17     5*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.6 ms | 1003 KiB | 16 Q