3v4l.org

run code in 300+ PHP versions simultaneously
<?php $r = array(); if (($num = count($r)) > 1) { $rr = array_rand($r, $num); } var_dump($r, $rr);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 10
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
filename:       /in/1ADUG
function name:  (null)
number of ops:  15
compiled vars:  !0 = $r, !1 = $num, !2 = $rr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        COUNT                                            ~4      !0
          2        ASSIGN                                           ~5      !1, ~4
          3        IS_SMALLER                                               1, ~5
          4      > JMPZ                                                     ~6, ->10
    5     5    >   INIT_FCALL                                               'array_rand'
          6        SEND_VAR                                                 !0
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                         $7      
          9        ASSIGN                                                   !2, $7
    7    10    >   INIT_FCALL                                               'var_dump'
         11        SEND_VAR                                                 !0
         12        SEND_VAR                                                 !2
         13        DO_ICALL                                                 
         14      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.43 ms | 1394 KiB | 17 Q