3v4l.org

run code in 300+ PHP versions simultaneously
<?php $values = array( 'foo', 'bar', 'baz', ); $index = round(rand(0, count($values) - 1)); var_dump($values[$index]);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CYlsn
function name:  (null)
number of ops:  16
compiled vars:  !0 = $values, !1 = $index
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    7     1        INIT_FCALL                                               'round'
          2        INIT_FCALL                                               'rand'
          3        SEND_VAL                                                 0
          4        COUNT                                            ~3      !0
          5        SUB                                              ~4      ~3, 1
          6        SEND_VAL                                                 ~4
          7        DO_ICALL                                         $5      
          8        SEND_VAR                                                 $5
          9        DO_ICALL                                         $6      
         10        ASSIGN                                                   !1, $6
    9    11        INIT_FCALL                                               'var_dump'
         12        FETCH_DIM_R                                      ~8      !0, !1
         13        SEND_VAL                                                 ~8
         14        DO_ICALL                                                 
         15      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.29 ms | 1394 KiB | 19 Q