3v4l.org

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

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

End of function uniquerandomnumberswithinrange

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.3 ms | 1399 KiB | 22 Q