3v4l.org

run code in 500+ PHP versions simultaneously
<?php $array = array( array("FIRST_NAME" => "Jon", "LAST_NAME" => "Doe"), array("FIRST_NAME" => "Jane", "LAST_NAME" => "Doe"), array("FIRST_NAME" => "Johnny", "LAST_NAME" => "Doe"), array("FIRST_NAME" => "Janie", "LAST_NAME" => "Doe")); $output = ""; foreach ($array as $i => $values) { // get the arrays in the outer array if ($i != 0) { // check if it is not the first element $output .= ", {$values['FIRST_NAME']} {$values['LAST_NAME']}"; } else { $output .= "{$values['FIRST_NAME']} {$values['LAST_NAME']}"; } } echo $output;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 22
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 22
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 15
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
filename:       /in/K5s82
function name:  (null)
number of ops:  25
compiled vars:  !0 = $array, !1 = $output, !2 = $values, !3 = $i
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                       !0, <array>
    8     1        ASSIGN                                                       !1, ''
   10     2      > FE_RESET_R                                           $6      !0, ->22
          3    > > FE_FETCH_R                                           ~7      $6, !2, ->22
          4    >   ASSIGN                                                       !3, ~7
   11     5        IS_NOT_EQUAL                                                 !3, 0
          6      > JMPZ                                                         ~9, ->15
   12     7    >   ROPE_INIT                                         4  ~13     '%2C+'
          8        FETCH_DIM_R                                          ~10     !2, 'FIRST_NAME'
          9        ROPE_ADD                                          1  ~13     ~13, ~10
         10        ROPE_ADD                                          2  ~13     ~13, '+'
         11        FETCH_DIM_R                                          ~11     !2, 'LAST_NAME'
         12        ROPE_END                                          3  ~12     ~13, ~11
         13        ASSIGN_OP                                         8          !1, ~12
   11    14      > JMP                                                          ->21
   14    15    >   FETCH_DIM_R                                          ~16     !2, 'FIRST_NAME'
         16        ROPE_INIT                                         3  ~19     ~16
         17        ROPE_ADD                                          1  ~19     ~19, '+'
         18        FETCH_DIM_R                                          ~17     !2, 'LAST_NAME'
         19        ROPE_END                                          2  ~18     ~19, ~17
         20        ASSIGN_OP                                         8          !1, ~18
   10    21    > > JMP                                                          ->3
         22    >   FE_FREE                                                      $6
   18    23        ECHO                                                         !1
         24      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
173.9 ms | 2054 KiB | 13 Q