3v4l.org

run code in 300+ PHP versions simultaneously
<?php $number_to_get = 2; $names = array("Maria", "Jan", "Elton", "Wiktor"); shuffle($names); $picks = array_slice(array_values($names), 0, $number_to_get); var_dump($picks);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/trWCu
function name:  (null)
number of ops:  18
compiled vars:  !0 = $number_to_get, !1 = $names, !2 = $picks
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 2
    4     1        ASSIGN                                                   !1, <array>
    5     2        INIT_FCALL                                               'shuffle'
          3        SEND_REF                                                 !1
          4        DO_ICALL                                                 
    6     5        INIT_FCALL                                               'array_slice'
          6        INIT_FCALL                                               'array_values'
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                         $6      
          9        SEND_VAR                                                 $6
         10        SEND_VAL                                                 0
         11        SEND_VAR                                                 !0
         12        DO_ICALL                                         $7      
         13        ASSIGN                                                   !2, $7
    7    14        INIT_FCALL                                               'var_dump'
         15        SEND_VAR                                                 !2
         16        DO_ICALL                                                 
         17      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.8 ms | 1394 KiB | 21 Q