3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
156.16 ms | 1144 KiB | 14 Q