3v4l.org

run code in 300+ PHP versions simultaneously
<?php $names = ['Adamino', 'Pete', 'Mark', 'Gonz']; $pairs = []; $plucked = array_rand($names, 2); $pair = [$names[$plucked[0]], $names[$plucked[1]]]; unset($names[$plucked[0]], $names[$plucked[1]]); $pairs[] = $pair; var_dump($pair); var_dump($pairs); var_dump($names); $result = "The PP randomizer has selected: \n"; foreach ($pairs as $p) { $result .= " -> {$p[0]} and {$p[1]}\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 31, Position 2 = 41
Branch analysis from position: 31
2 jumps found. (Code = 78) Position 1 = 32, Position 2 = 41
Branch analysis from position: 32
1 jumps found. (Code = 42) Position 1 = 31
Branch analysis from position: 31
Branch analysis from position: 41
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 41
filename:       /in/8GUZY
function name:  (null)
number of ops:  43
compiled vars:  !0 = $names, !1 = $pairs, !2 = $plucked, !3 = $pair, !4 = $result, !5 = $p
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        ASSIGN                                                   !1, <array>
    7     2        INIT_FCALL                                               'array_rand'
          3        SEND_VAR                                                 !0
          4        SEND_VAL                                                 2
          5        DO_ICALL                                         $8      
          6        ASSIGN                                                   !2, $8
    9     7        FETCH_DIM_R                                      ~10     !2, 0
          8        FETCH_DIM_R                                      ~11     !0, ~10
          9        INIT_ARRAY                                       ~12     ~11
         10        FETCH_DIM_R                                      ~13     !2, 1
         11        FETCH_DIM_R                                      ~14     !0, ~13
         12        ADD_ARRAY_ELEMENT                                ~12     ~14
         13        ASSIGN                                                   !3, ~12
   10    14        FETCH_DIM_R                                      ~16     !2, 0
         15        UNSET_DIM                                                !0, ~16
         16        FETCH_DIM_R                                      ~17     !2, 1
         17        UNSET_DIM                                                !0, ~17
   12    18        ASSIGN_DIM                                               !1
         19        OP_DATA                                                  !3
   14    20        INIT_FCALL                                               'var_dump'
         21        SEND_VAR                                                 !3
         22        DO_ICALL                                                 
   15    23        INIT_FCALL                                               'var_dump'
         24        SEND_VAR                                                 !1
         25        DO_ICALL                                                 
   16    26        INIT_FCALL                                               'var_dump'
         27        SEND_VAR                                                 !0
         28        DO_ICALL                                                 
   19    29        ASSIGN                                                   !4, 'The+PP+randomizer+has+selected%3A+%0A'
   20    30      > FE_RESET_R                                       $23     !1, ->41
         31    > > FE_FETCH_R                                               $23, !5, ->41
   21    32    >   ROPE_INIT                                     5  ~27     '+-%3E+'
         33        FETCH_DIM_R                                      ~24     !5, 0
         34        ROPE_ADD                                      1  ~27     ~27, ~24
         35        ROPE_ADD                                      2  ~27     ~27, '+and+'
         36        FETCH_DIM_R                                      ~25     !5, 1
         37        ROPE_ADD                                      3  ~27     ~27, ~25
         38        ROPE_END                                      4  ~26     ~27, '%0A'
         39        ASSIGN_OP                                     8          !4, ~26
   20    40      > JMP                                                      ->31
         41    >   FE_FREE                                                  $23
   22    42      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.15 ms | 1392 KiB | 17 Q