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 ); $post = array(); array_walk($show, function($x, $i) use ($post) { $x = true; // in your case $x = isset($post[$i]); }); var_dump($show);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Vf6go
function name:  (null)
number of ops:  12
compiled vars:  !0 = $show, !1 = $post
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   13     1        ASSIGN                                                   !1, <array>
   15     2        INIT_FCALL                                               'array_walk'
          3        SEND_REF                                                 !0
          4        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FVf6go%3A15%240'
          5        BIND_LEXICAL                                             ~4, !1
   17     6        SEND_VAL                                                 ~4
          7        DO_ICALL                                                 
   19     8        INIT_FCALL                                               'var_dump'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                                 
         11      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FVf6go%3A15%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Vf6go
function name:  {closure}
number of ops:  5
compiled vars:  !0 = $x, !1 = $i, !2 = $post
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        BIND_STATIC                                              !2
   16     3        ASSIGN                                                   !0, <true>
   17     4      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FVf6go%3A15%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.03 ms | 1386 KiB | 17 Q