3v4l.org

run code in 300+ PHP versions simultaneously
<?php function randomGen($min, $max, $quantity) { $numbers = range($min, $max); shuffle($numbers); return array_slice($numbers, 0, $quantity); } $y = randomGen(0,12,12); $y = range(0,12); print_r($y) ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hdQXf
function name:  (null)
number of ops:  15
compiled vars:  !0 = $y
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_FCALL                                               'randomgen'
          1        SEND_VAL                                                 0
          2        SEND_VAL                                                 12
          3        SEND_VAL                                                 12
          4        DO_FCALL                                      0  $1      
          5        ASSIGN                                                   !0, $1
    8     6        INIT_FCALL                                               'range'
          7        SEND_VAL                                                 0
          8        SEND_VAL                                                 12
          9        DO_ICALL                                         $3      
         10        ASSIGN                                                   !0, $3
   10    11        INIT_FCALL                                               'print_r'
         12        SEND_VAR                                                 !0
         13        DO_ICALL                                                 
   13    14      > RETURN                                                   1

Function randomgen:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hdQXf
function name:  randomGen
number of ops:  18
compiled vars:  !0 = $min, !1 = $max, !2 = $quantity, !3 = $numbers
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
    3     3        INIT_FCALL                                               'range'
          4        SEND_VAR                                                 !0
          5        SEND_VAR                                                 !1
          6        DO_ICALL                                         $4      
          7        ASSIGN                                                   !3, $4
    4     8        INIT_FCALL                                               'shuffle'
          9        SEND_REF                                                 !3
         10        DO_ICALL                                                 
    5    11        INIT_FCALL                                               'array_slice'
         12        SEND_VAR                                                 !3
         13        SEND_VAL                                                 0
         14        SEND_VAR                                                 !2
         15        DO_ICALL                                         $7      
         16      > RETURN                                                   $7
    6    17*     > RETURN                                                   null

End of function randomgen

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.28 ms | 1403 KiB | 22 Q