3v4l.org

run code in 300+ PHP versions simultaneously
<?php $colors = ['red' => '#110000', 'blue' => '000011', 'brown' => '#A52A2A', 'maroon' => '#800000']; function assoc_shuffle ( $arr ) { uasort($arr, function ($a, $b) { return rand(-1, 1); }); return $arr; } print_r( assoc_shuffle( $colors ) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/g806a
function name:  (null)
number of ops:  8
compiled vars:  !0 = $colors
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   13     1        INIT_FCALL                                               'print_r'
          2        INIT_FCALL                                               'assoc_shuffle'
          3        SEND_VAR                                                 !0
          4        DO_FCALL                                      0  $2      
          5        SEND_VAR                                                 $2
          6        DO_ICALL                                                 
          7      > RETURN                                                   1

Function assoc_shuffle:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/g806a
function name:  assoc_shuffle
number of ops:  8
compiled vars:  !0 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    6     1        INIT_FCALL                                               'uasort'
          2        SEND_REF                                                 !0
          3        DECLARE_LAMBDA_FUNCTION                          ~1      [0]
    8     4        SEND_VAL                                                 ~1
    6     5        DO_ICALL                                                 
    9     6      > RETURN                                                   !0
   10     7*     > RETURN                                                   null


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/g806a
function name:  {closure}
number of ops:  8
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    7     2        INIT_FCALL                                               'rand'
          3        SEND_VAL                                                 -1
          4        SEND_VAL                                                 1
          5        DO_ICALL                                         $2      
          6      > RETURN                                                   $2
    8     7*     > RETURN                                                   null

End of Dynamic Function 0

End of function assoc_shuffle

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.39 ms | 1016 KiB | 17 Q