3v4l.org

run code in 500+ PHP versions simultaneously
<?php $arrays[] = array(); $arrays[] = array('user1'); $arrays[] = array('user1', 'user2'); $arrays[] = array('user1', 'user2', 'user3'); $arrays[] = array('user1', 'user2', 'user3', 'user4'); $arrays[] = array('user1', 'user2', 'user3', 'user4', 'user5'); foreach ($arrays as $i => $array) { $count = count($array); printf( "TEST %d: %s\n---\n", $i, match ($count) { 0 => 'nobody', 1 => $array[0], 2 => implode(' and ', $array), 3 => "{$array[0]}, {$array[1]}, and {$array[2]}", default => "{$array[0]}, {$array[1]}, {$array[2]}, and " . $count - 3 . " other" . ($count != 4 ? 's' : '') } ); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 13, Position 2 = 62
Branch analysis from position: 13
2 jumps found. (Code = 78) Position 1 = 14, Position 2 = 62
Branch analysis from position: 14
5 jumps found. (Code = 195) Position 1 = 21, Position 2 = 23, Position 3 = 26, Position 4 = 29, Position 5 = 39
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 59
Branch analysis from position: 59
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 59
Branch analysis from position: 59
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 59
Branch analysis from position: 59
Branch analysis from position: 29
1 jumps found. (Code = 42) Position 1 = 59
Branch analysis from position: 59
Branch analysis from position: 39
2 jumps found. (Code = 43) Position 1 = 53, Position 2 = 55
Branch analysis from position: 53
1 jumps found. (Code = 42) Position 1 = 56
Branch analysis from position: 56
1 jumps found. (Code = 42) Position 1 = 59
Branch analysis from position: 59
Branch analysis from position: 55
1 jumps found. (Code = 42) Position 1 = 59
Branch analysis from position: 59
Branch analysis from position: 62
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 62
filename:       /in/TPQE5
function name:  (null)
number of ops:  64
compiled vars:  !0 = $arrays, !1 = $array, !2 = $i, !3 = $count
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   ASSIGN_DIM                                                   !0
          1        OP_DATA                                                      <array>
    3     2        ASSIGN_DIM                                                   !0
          3        OP_DATA                                                      <array>
    4     4        ASSIGN_DIM                                                   !0
          5        OP_DATA                                                      <array>
    5     6        ASSIGN_DIM                                                   !0
          7        OP_DATA                                                      <array>
    6     8        ASSIGN_DIM                                                   !0
          9        OP_DATA                                                      <array>
    7    10        ASSIGN_DIM                                                   !0
         11        OP_DATA                                                      <array>
    9    12      > FE_RESET_R                                           $10     !0, ->62
         13    > > FE_FETCH_R                                           ~11     $10, !1, ->62
         14    >   ASSIGN                                                       !2, ~11
   10    15        COUNT                                                ~13     !1
         16        ASSIGN                                                       !3, ~13
   11    17        INIT_FCALL                                                   'printf'
   12    18        SEND_VAL                                                     'TEST+%25d%3A+%25s%0A---%0A'
   13    19        SEND_VAR                                                     !2
   14    20      > MATCH                                                        !3, [ 0:->21, 1:->23, 2:->26, 3:->29, ], ->39
   15    21    >   QM_ASSIGN                                            ~16     'nobody'
         22      > JMP                                                          ->59
   16    23    >   FETCH_DIM_R                                          ~17     !1, 0
         24        QM_ASSIGN                                            ~16     ~17
         25      > JMP                                                          ->59
   17    26    >   FRAMELESS_ICALL_2                implode             ~18     '+and+', !1
         27        QM_ASSIGN                                            ~16     ~18
         28      > JMP                                                          ->59
   18    29    >   FETCH_DIM_R                                          ~19     !1, 0
         30        ROPE_INIT                                         5  ~23     ~19
         31        ROPE_ADD                                          1  ~23     ~23, '%2C+'
         32        FETCH_DIM_R                                          ~20     !1, 1
         33        ROPE_ADD                                          2  ~23     ~23, ~20
         34        ROPE_ADD                                          3  ~23     ~23, '%2C+and+'
         35        FETCH_DIM_R                                          ~21     !1, 2
         36        ROPE_END                                          4  ~22     ~23, ~21
         37        QM_ASSIGN                                            ~16     ~22
         38      > JMP                                                          ->59
   19    39    >   FETCH_DIM_R                                          ~26     !1, 0
         40        ROPE_INIT                                         6  ~30     ~26
         41        ROPE_ADD                                          1  ~30     ~30, '%2C+'
         42        FETCH_DIM_R                                          ~27     !1, 1
         43        ROPE_ADD                                          2  ~30     ~30, ~27
         44        ROPE_ADD                                          3  ~30     ~30, '%2C+'
         45        FETCH_DIM_R                                          ~28     !1, 2
         46        ROPE_ADD                                          4  ~30     ~30, ~28
         47        ROPE_END                                          5  ~29     ~30, '%2C+and+'
         48        SUB                                                  ~33     !3, 3
         49        CONCAT                                               ~34     ~29, ~33
         50        CONCAT                                               ~35     ~34, '+other'
         51        IS_NOT_EQUAL                                                 !3, 4
         52      > JMPZ                                                         ~36, ->55
         53    >   QM_ASSIGN                                            ~37     's'
         54      > JMP                                                          ->56
         55    >   QM_ASSIGN                                            ~37     ''
         56    >   CONCAT                                               ~38     ~35, ~37
         57        QM_ASSIGN                                            ~16     ~38
         58      > JMP                                                          ->59
         59    >   SEND_VAL                                                     ~16
   11    60        DO_ICALL                                                     
    9    61      > JMP                                                          ->13
         62    >   FE_FREE                                                      $10
   22    63      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
159.6 ms | 2030 KiB | 14 Q