3v4l.org

run code in 300+ PHP versions simultaneously
<?php $users = [['username' => 'Timothy'], ['username' => 'Frederic']]; $users2 = [['username' => 'Johnathon'], ['username' => 'Frederic'], ['username' => 'Peter']]; $counts = array_count_values( [ ...array_column($users, 'username'), ...array_column($users2, 'username') ] ); foreach ($counts as $user => $count) { printf( "<option%s>%s</option>\n", $count > 1 ? ' selected' : '', htmlentities($user) ); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 18, Position 2 = 34
Branch analysis from position: 18
2 jumps found. (Code = 78) Position 1 = 19, Position 2 = 34
Branch analysis from position: 19
2 jumps found. (Code = 43) Position 1 = 24, Position 2 = 26
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 27
Branch analysis from position: 27
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
Branch analysis from position: 34
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 34
filename:       /in/1PPr3
function name:  (null)
number of ops:  36
compiled vars:  !0 = $users, !1 = $users2, !2 = $counts, !3 = $count, !4 = $user
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, <array>
    6     2        INIT_FCALL                                               'array_count_values'
    8     3        INIT_FCALL                                               'array_column'
          4        SEND_VAR                                                 !0
          5        SEND_VAL                                                 'username'
          6        DO_ICALL                                         $7      
          7        INIT_ARRAY                                       ~8      
          8        ADD_ARRAY_UNPACK                                 ~8      $7
    9     9        INIT_FCALL                                               'array_column'
         10        SEND_VAR                                                 !1
         11        SEND_VAL                                                 'username'
         12        DO_ICALL                                         $9      
         13        ADD_ARRAY_UNPACK                                 ~8      $9
         14        SEND_VAL                                                 ~8
    6    15        DO_ICALL                                         $10     
         16        ASSIGN                                                   !2, $10
   12    17      > FE_RESET_R                                       $12     !2, ->34
         18    > > FE_FETCH_R                                       ~13     $12, !3, ->34
         19    >   ASSIGN                                                   !4, ~13
   13    20        INIT_FCALL                                               'printf'
   14    21        SEND_VAL                                                 '%3Coption%25s%3E%25s%3C%2Foption%3E%0A'
   15    22        IS_SMALLER                                               1, !3
         23      > JMPZ                                                     ~15, ->26
         24    >   QM_ASSIGN                                        ~16     '+selected'
         25      > JMP                                                      ->27
         26    >   QM_ASSIGN                                        ~16     ''
         27    >   SEND_VAL                                                 ~16
   16    28        INIT_FCALL                                               'htmlentities'
         29        SEND_VAR                                                 !4
         30        DO_ICALL                                         $17     
         31        SEND_VAR                                                 $17
   13    32        DO_ICALL                                                 
   12    33      > JMP                                                      ->18
         34    >   FE_FREE                                                  $12
   18    35      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.02 ms | 1014 KiB | 17 Q