3v4l.org

run code in 300+ PHP versions simultaneously
<?php $test = [ ['id' => 13, 'pets' => 8], ['id' => 15, 'pets' => 8], ['id' => 16, 'pets' => 10], ['id' => 17, 'pets' => 9], ['id' => 18, 'pets' => 10], ['id' => 19, 'pets' => 10], ['id' => 20, 'pets' => 0], ['id' => 21, 'pets' => 8], ['id' => 22, 'pets' => 9], ['id' => 23, 'pets' => 4], ['id' => 24, 'pets' => 0], ['id' => 40, 'pets' => 8], ['id' => 43, 'pets' => 2], ]; for ($x = 0, $delim = ''; $x < 5; ++$x, $delim = ',') { echo $delim . $test[array_rand($test)]['id']; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
2 jumps found. (Code = 44) Position 1 = 15, Position 2 = 4
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
2 jumps found. (Code = 44) Position 1 = 15, Position 2 = 4
Branch analysis from position: 15
Branch analysis from position: 4
filename:       /in/TDDlC
function name:  (null)
number of ops:  16
compiled vars:  !0 = $test, !1 = $x, !2 = $delim
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   19     1        ASSIGN                                                   !1, 0
          2        ASSIGN                                                   !2, ''
          3      > JMP                                                      ->13
   20     4    >   INIT_FCALL                                               'array_rand'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $6      
          7        FETCH_DIM_R                                      ~7      !0, $6
          8        FETCH_DIM_R                                      ~8      ~7, 'id'
          9        CONCAT                                           ~9      !2, ~8
         10        ECHO                                                     ~9
   19    11        PRE_INC                                                  !1
         12        ASSIGN                                                   !2, '%2C'
         13    >   IS_SMALLER                                               !1, 5
         14      > JMPNZ                                                    ~12, ->4
   21    15    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.77 ms | 999 KiB | 14 Q