3v4l.org

run code in 300+ PHP versions simultaneously
<?php $show = array( 'mon' => false, 'tue' => false, 'wed' => false, 'thu' => false, 'fri' => false, 'sat' => false, 'sun' => false ); $key = array_keys($show); foreach (range(0,6) as $index) { $key = $keys[$index]; $show[$index] |= true; // in your case |= isset($post[$index]); } var_dump($show);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 10, Position 2 = 16
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 16
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
filename:       /in/VG90j
function name:  (null)
number of ops:  21
compiled vars:  !0 = $show, !1 = $key, !2 = $index, !3 = $keys
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   13     1        INIT_FCALL                                               'array_keys'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $5      
          4        ASSIGN                                                   !1, $5
   15     5        INIT_FCALL                                               'range'
          6        SEND_VAL                                                 0
          7        SEND_VAL                                                 6
          8        DO_ICALL                                         $7      
          9      > FE_RESET_R                                       $8      $7, ->16
         10    > > FE_FETCH_R                                               $8, !2, ->16
   16    11    >   FETCH_DIM_R                                      ~9      !3, !2
         12        ASSIGN                                                   !1, ~9
   17    13        ASSIGN_DIM_OP                |=               9          !0, !2
         14        OP_DATA                                                  <true>
   15    15      > JMP                                                      ->10
         16    >   FE_FREE                                                  $8
   21    17        INIT_FCALL                                               'var_dump'
         18        SEND_VAR                                                 !0
         19        DO_ICALL                                                 
         20      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
176.59 ms | 1395 KiB | 19 Q