3v4l.org

run code in 500+ PHP versions simultaneously
<?php $n_data= [ "checklist1" => "major", "result_audit1" => "1", "checklist2" => "minor", "result_audit2" => "2", "checklist3" => "pico", "result_audit3" => "3", "checklist4" => "goodpoints", "result_audit4" => "4", "submit" => "Submit Now", ]; $chunked['checklist'] = array_chunk(array_splice($n_data, 0, count($n_data) - 1), 2); array_walk($chunked['checklist'], fn(&$v, $idx) => $v = ['selected' => $v[0], 'result_audit' => $v[1], 'origin' => 'checklist'. ($idx + 1)]); print_r($chunked);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NKWnO
function name:  (null)
number of ops:  24
compiled vars:  !0 = $n_data, !1 = $chunked
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
   15     1        INIT_FCALL                                                   'array_chunk'
          2        INIT_FCALL                                                   'array_splice'
          3        SEND_REF                                                     !0
          4        SEND_VAL                                                     0
          5        COUNT                                                ~4      !0
          6        SUB                                                  ~5      ~4, 1
          7        SEND_VAL                                                     ~5
          8        DO_ICALL                                             $6      
          9        SEND_VAR                                                     $6
         10        SEND_VAL                                                     2
         11        DO_ICALL                                             $7      
         12        ASSIGN_DIM                                                   !1, 'checklist'
         13        OP_DATA                                                      $7
   16    14        INIT_FCALL                                                   'array_walk'
         15        FETCH_DIM_W                                          $8      !1, 'checklist'
         16        SEND_REF                                                     $8
         17        DECLARE_LAMBDA_FUNCTION                              ~9      [0]
         18        SEND_VAL                                                     ~9
         19        DO_ICALL                                                     
   17    20        INIT_FCALL                                                   'print_r'
         21        SEND_VAR                                                     !1
         22        DO_ICALL                                                     
         23      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NKWnO
function name:  {closure:/in/NKWnO:16}
number of ops:  12
compiled vars:  !0 = $v, !1 = $idx
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   16     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
          2        FETCH_DIM_R                                          ~2      !0, 0
          3        INIT_ARRAY                                           ~3      ~2, 'selected'
          4        FETCH_DIM_R                                          ~4      !0, 1
          5        ADD_ARRAY_ELEMENT                                    ~3      ~4, 'result_audit'
          6        ADD                                                  ~5      !1, 1
          7        CONCAT                                               ~6      'checklist', ~5
          8        ADD_ARRAY_ELEMENT                                    ~3      ~6, 'origin'
          9        ASSIGN                                               ~7      !0, ~3
         10      > RETURN                                                       ~7
         11*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
187.08 ms | 1839 KiB | 17 Q