3v4l.org

run code in 300+ PHP versions simultaneously
<?php $hot = array( 'hotObj 1', 'hotObj 2', 'hotObj 3', 'hotObj 4', ); $new = array( 'newObj 1', 'newObj 2', ); $result = []; foreach ($hot as $key => $value) { $result[] = $value; if(isset($new[$key])){ $result[] = $new[$key]; } } print_r($result);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 14
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 14
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 13
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 13
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
filename:       /in/WTX7o
function name:  (null)
number of ops:  19
compiled vars:  !0 = $hot, !1 = $new, !2 = $result, !3 = $value, !4 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   10     1        ASSIGN                                                   !1, <array>
   14     2        ASSIGN                                                   !2, <array>
   15     3      > FE_RESET_R                                       $8      !0, ->14
          4    > > FE_FETCH_R                                       ~9      $8, !3, ->14
          5    >   ASSIGN                                                   !4, ~9
   16     6        ASSIGN_DIM                                               !2
          7        OP_DATA                                                  !3
   17     8        ISSET_ISEMPTY_DIM_OBJ                         0          !1, !4
          9      > JMPZ                                                     ~12, ->13
   18    10    >   FETCH_DIM_R                                      ~14     !1, !4
         11        ASSIGN_DIM                                               !2
         12        OP_DATA                                                  ~14
   15    13    > > JMP                                                      ->4
         14    >   FE_FREE                                                  $8
   21    15        INIT_FCALL                                               'print_r'
         16        SEND_VAR                                                 !2
         17        DO_ICALL                                                 
         18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.7 ms | 1395 KiB | 15 Q