3v4l.org

run code in 500+ PHP versions simultaneously
<?php $src = ["apple", "cherry", "grape", "lemon", "orange", "strawberry"]; $dst = ["apple", "banana", "cherry", "orange", "pear"]; $src = array_combine($src, $src); $dst = array_combine($dst, $dst); $combined_items = $src + $dst; ksort($combined_items); $result = []; foreach ($combined_items as $item) { $result[] = [ $src[$item] ?? null, $dst[$item] ?? null ]; } echo "<table border=1> "; foreach ($result as $i => [$s, $d]) { printf( "<tr> <td>%d</td> <td>%s</td> <td>%s</td> </tr>\n", ++$i, $s, $d ); } echo "</table>";
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 19, Position 2 = 31
Branch analysis from position: 19
2 jumps found. (Code = 78) Position 1 = 20, Position 2 = 31
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
Branch analysis from position: 31
2 jumps found. (Code = 77) Position 1 = 34, Position 2 = 49
Branch analysis from position: 34
2 jumps found. (Code = 78) Position 1 = 35, Position 2 = 49
Branch analysis from position: 35
1 jumps found. (Code = 42) Position 1 = 34
Branch analysis from position: 34
Branch analysis from position: 49
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 49
Branch analysis from position: 31
filename:       /in/RKp2O
function name:  (null)
number of ops:  52
compiled vars:  !0 = $src, !1 = $dst, !2 = $combined_items, !3 = $result, !4 = $item, !5 = $s, !6 = $d, !7 = $i
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
    4     1        ASSIGN                                                       !1, <array>
    6     2        INIT_FCALL                                                   'array_combine'
          3        SEND_VAR                                                     !0
          4        SEND_VAR                                                     !0
          5        DO_ICALL                                             $10     
          6        ASSIGN                                                       !0, $10
    7     7        INIT_FCALL                                                   'array_combine'
          8        SEND_VAR                                                     !1
          9        SEND_VAR                                                     !1
         10        DO_ICALL                                             $12     
         11        ASSIGN                                                       !1, $12
    8    12        ADD                                                  ~14     !0, !1
         13        ASSIGN                                                       !2, ~14
    9    14        INIT_FCALL                                                   'ksort'
         15        SEND_REF                                                     !2
         16        DO_ICALL                                                     
   11    17        ASSIGN                                                       !3, <array>
   12    18      > FE_RESET_R                                           $18     !2, ->31
         19    > > FE_FETCH_R                                                   $18, !4, ->31
   14    20    >   FETCH_DIM_IS                                         ~20     !0, !4
         21        COALESCE                                             ~21     ~20
         22        QM_ASSIGN                                            ~21     null
         23        INIT_ARRAY                                           ~22     ~21
   15    24        FETCH_DIM_IS                                         ~23     !1, !4
         25        COALESCE                                             ~24     ~23
   14    26        QM_ASSIGN                                            ~24     null
         27        ADD_ARRAY_ELEMENT                                    ~22     ~24
   13    28        ASSIGN_DIM                                                   !3
   14    29        OP_DATA                                                      ~22
   12    30      > JMP                                                          ->19
         31    >   FE_FREE                                                      $18
   19    32        ECHO                                                         '%3Ctable+border%3D1%3E%0A'
   21    33      > FE_RESET_R                                           $25     !3, ->49
         34    > > FE_FETCH_R                                           ~31     $25, $26, ->49
         35    >   FETCH_LIST_R                                         $27     $26, 0
         36        ASSIGN                                                       !5, $27
         37        FETCH_LIST_R                                         $29     $26, 1
         38        ASSIGN                                                       !6, $29
         39        FREE                                                         $26
         40        ASSIGN                                                       !7, ~31
   22    41        INIT_FCALL                                                   'printf'
   23    42        SEND_VAL                                                     '%3Ctr%3E%0A+++++++++++++%3Ctd%3E%25d%3C%2Ftd%3E%0A+++++++++++++%3Ctd%3E%25s%3C%2Ftd%3E%0A+++++++++++++%3Ctd%3E%25s%3C%2Ftd%3E%0A+++++++++%3C%2Ftr%3E%0A'
   28    43        PRE_INC                                              ~33     !7
         44        SEND_VAL                                                     ~33
   29    45        SEND_VAR                                                     !5
   30    46        SEND_VAR                                                     !6
   22    47        DO_ICALL                                                     
   21    48      > JMP                                                          ->34
         49    >   FE_FREE                                                      $25
   33    50        ECHO                                                         '%3C%2Ftable%3E'
         51      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
148.01 ms | 2043 KiB | 16 Q