3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = array( array( "pages_coded" => "5", "type_of_request" => "Collector Tweak", "userfullname" => "Sam", ), array( "pages_coded" => "5", "type_of_request" => "Collector Code", "userfullname" => "John", ), array( "pages_coded" => "42", "type_of_request" => "Collector Tweak", "userfullname" => "John", ), array( "pages_coded" => "37", "type_of_request" => "Clinical Tweak", "userfullname" => "Dona", ), array( "pages_coded" => "35", "type_of_request" => "Collector Code", "userfullname" => "Dona", ), array( "pages_coded" => "7", "type_of_request" => "Clinical Code", "userfullname" => "Ricky", ), array( "pages_coded" => "50", "type_of_request" => "Clinical Tweak", "userfullname" => "Ricky", ), array( "pages_coded" => "4", "type_of_request" => "Collector Code", "userfullname" => "Ricky", ), array( "pages_coded" => "17", "type_of_request" => "Collector Tweak", "userfullname" => "Ricky", ) ); $output = array(); foreach ($data as $row) { $output[$row['userfullname']][$row['type_of_request']] = $row['pages_coded']; } $categories = array( 'Clinical Code' => 0, 'Clinical Tweak' => 0, 'Collector Code' => 0, 'Collector Tweak' => 0, ); foreach ($output as &$outputItem) { $outputItem = array_merge($categories, $outputItem); } echo "<pre>"; print_r($output);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 11
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 11
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 11
2 jumps found. (Code = 125) Position 1 = 14, Position 2 = 21
Branch analysis from position: 14
2 jumps found. (Code = 126) Position 1 = 15, Position 2 = 21
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
Branch analysis from position: 11
filename:       /in/0k40Q
function name:  (null)
number of ops:  27
compiled vars:  !0 = $data, !1 = $output, !2 = $row, !3 = $categories, !4 = $outputItem
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   51     1        ASSIGN                                                   !1, <array>
   52     2      > FE_RESET_R                                       $7      !0, ->11
          3    > > FE_FETCH_R                                               $7, !2, ->11
   53     4    >   FETCH_DIM_R                                      ~8      !2, 'userfullname'
          5        FETCH_DIM_R                                      ~10     !2, 'type_of_request'
          6        FETCH_DIM_R                                      ~12     !2, 'pages_coded'
          7        FETCH_DIM_W                                      $9      !1, ~8
          8        ASSIGN_DIM                                               $9, ~10
          9        OP_DATA                                                  ~12
   52    10      > JMP                                                      ->3
         11    >   FE_FREE                                                  $7
   56    12        ASSIGN                                                   !3, <array>
   62    13      > FE_RESET_RW                                      $14     !1, ->21
         14    > > FE_FETCH_RW                                              $14, !4, ->21
   63    15    >   INIT_FCALL                                               'array_merge'
         16        SEND_VAR                                                 !3
         17        SEND_VAR                                                 !4
         18        DO_ICALL                                         $15     
         19        ASSIGN                                                   !4, $15
   62    20      > JMP                                                      ->14
         21    >   FE_FREE                                                  $14
   66    22        ECHO                                                     '%3Cpre%3E'
   67    23        INIT_FCALL                                               'print_r'
         24        SEND_VAR                                                 !1
         25        DO_ICALL                                                 
         26      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
192.87 ms | 1012 KiB | 15 Q