3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dealers = [ ['id' => 1526, 'count' => 2], ['id' => 1518, 'count' => 5], ['id' => 1511, 'count' => 2], ['id' => 1410, 'count' => 3], ]; $counts = array_column($dealers, 'count'); $indexes = array_keys($counts, min($counts)); var_export($indexes ? $dealers[$indexes[array_rand($indexes)]] : null);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 23
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/S09Rn
function name:  (null)
number of ops:  27
compiled vars:  !0 = $dealers, !1 = $counts, !2 = $indexes
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   10     1        INIT_FCALL                                               'array_column'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 'count'
          4        DO_ICALL                                         $4      
          5        ASSIGN                                                   !1, $4
   11     6        INIT_FCALL                                               'array_keys'
          7        SEND_VAR                                                 !1
          8        INIT_FCALL                                               'min'
          9        SEND_VAR                                                 !1
         10        DO_ICALL                                         $6      
         11        SEND_VAR                                                 $6
         12        DO_ICALL                                         $7      
         13        ASSIGN                                                   !2, $7
   12    14        INIT_FCALL                                               'var_export'
         15      > JMPZ                                                     !2, ->23
         16    >   INIT_FCALL                                               'array_rand'
         17        SEND_VAR                                                 !2
         18        DO_ICALL                                         $9      
         19        FETCH_DIM_R                                      ~10     !2, $9
         20        FETCH_DIM_R                                      ~11     !0, ~10
         21        QM_ASSIGN                                        ~12     ~11
         22      > JMP                                                      ->24
         23    >   QM_ASSIGN                                        ~12     null
         24    >   SEND_VAL                                                 ~12
         25        DO_ICALL                                                 
         26      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.84 ms | 1014 KiB | 18 Q