3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr0 = [ [ 'id' => 107, 'name' => 'Sarah', 'msgSinleer' => 2, 'subject' => [], ], [ 'id' => 110, 'name' => 'Manuela', 'msgSinleer' => 27, 'subject' => [], ], ]; $arr1 = [ [ 'id' => 110, 'Cliente' => 'Alexis', 'body' => 'Hola', 'fecha' => '06/01/2021 11:35 AM', 'status' => 1, 'tiempoSinLeer' => '15 01:00', ], [ 'id' => 110, 'Cliente' => 'Alexis', 'body' => 'Hola asd asdasd', 'fecha' => '05/26/2021 11:35 AM', 'status' => 1, 'tiempoSinLeer' => '21 01:00', ], [ 'id' => 107, 'Cliente' => 'George', 'body' => 'vhgfshsgf', 'fecha' => '06/15/2021 03:48 PM', 'status' => 1, 'tiempoSinLeer' => '1 08:48', ], ]; foreach($arr0 as $key => $record) { foreach($arr1 as $subject) { if($record['id'] === $subject['id']) $arr0[$key]['subject'][] = $subject; } } echo '<pre>'; print_r($arr0); echo '</pre>';
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 18
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 18
Branch analysis from position: 4
2 jumps found. (Code = 77) Position 1 = 6, Position 2 = 16
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 16
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 15
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 15
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 16
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
filename:       /in/e7NL6A
function name:  (null)
number of ops:  25
compiled vars:  !0 = $arr0, !1 = $arr1, !2 = $record, !3 = $key, !4 = $subject
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   17     1        ASSIGN                                                   !1, <array>
   44     2      > FE_RESET_R                                       $7      !0, ->18
          3    > > FE_FETCH_R                                       ~8      $7, !2, ->18
          4    >   ASSIGN                                                   !3, ~8
   45     5      > FE_RESET_R                                       $10     !1, ->16
          6    > > FE_FETCH_R                                               $10, !4, ->16
   46     7    >   FETCH_DIM_R                                      ~11     !2, 'id'
          8        FETCH_DIM_R                                      ~12     !4, 'id'
          9        IS_IDENTICAL                                             ~11, ~12
         10      > JMPZ                                                     ~13, ->15
         11    >   FETCH_DIM_W                                      $14     !0, !3
         12        FETCH_DIM_W                                      $15     $14, 'subject'
         13        ASSIGN_DIM                                               $15
         14        OP_DATA                                                  !4
   45    15    > > JMP                                                      ->6
         16    >   FE_FREE                                                  $10
   44    17      > JMP                                                      ->3
         18    >   FE_FREE                                                  $7
   50    19        ECHO                                                     '%3Cpre%3E'
   51    20        INIT_FCALL                                               'print_r'
         21        SEND_VAR                                                 !0
         22        DO_ICALL                                                 
   52    23        ECHO                                                     '%3C%2Fpre%3E'
         24      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.81 ms | 1003 KiB | 14 Q