3v4l.org

run code in 300+ 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) { echo "TEST $i: "; if (!$count = sizeof($array)) { echo "nobody"; } elseif ($count == 1) { echo $array[0]; } elseif ($count == 2) { echo "{$array[0]} and {$array[1]}"; } elseif ($count == 3) { echo "{$array[0]}, {$array[1]}, and {$array[2]}"; } else { echo "{$array[0]}, {$array[1]}, {$array[2]}, and " , $count - 3, " other" , ($count != 4 ? 's' : ''); } echo "\n---\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 13, Position 2 = 72
Branch analysis from position: 13
2 jumps found. (Code = 78) Position 1 = 14, Position 2 = 72
Branch analysis from position: 14
2 jumps found. (Code = 43) Position 1 = 23, Position 2 = 25
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 70
Branch analysis from position: 70
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
Branch analysis from position: 25
2 jumps found. (Code = 43) Position 1 = 27, Position 2 = 30
Branch analysis from position: 27
1 jumps found. (Code = 42) Position 1 = 70
Branch analysis from position: 70
Branch analysis from position: 30
2 jumps found. (Code = 43) Position 1 = 32, Position 2 = 39
Branch analysis from position: 32
1 jumps found. (Code = 42) Position 1 = 70
Branch analysis from position: 70
Branch analysis from position: 39
2 jumps found. (Code = 43) Position 1 = 41, Position 2 = 51
Branch analysis from position: 41
1 jumps found. (Code = 42) Position 1 = 70
Branch analysis from position: 70
Branch analysis from position: 51
2 jumps found. (Code = 43) Position 1 = 66, Position 2 = 68
Branch analysis from position: 66
1 jumps found. (Code = 42) Position 1 = 69
Branch analysis from position: 69
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
Branch analysis from position: 68
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
Branch analysis from position: 72
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 72
filename:       /in/UUbhp
function name:  (null)
number of ops:  74
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, ->72
         13    > > FE_FETCH_R                                       ~11     $10, !1, ->72
         14    >   ASSIGN                                                   !2, ~11
   10    15        ROPE_INIT                                     3  ~14     'TEST+'
         16        ROPE_ADD                                      1  ~14     ~14, !2
         17        ROPE_END                                      2  ~13     ~14, '%3A+'
         18        ECHO                                                     ~13
   11    19        COUNT                                            ~16     !1
         20        ASSIGN                                           ~17     !3, ~16
         21        BOOL_NOT                                         ~18     ~17
         22      > JMPZ                                                     ~18, ->25
   12    23    >   ECHO                                                     'nobody'
   11    24      > JMP                                                      ->70
   13    25    >   IS_EQUAL                                                 !3, 1
         26      > JMPZ                                                     ~19, ->30
   14    27    >   FETCH_DIM_R                                      ~20     !1, 0
         28        ECHO                                                     ~20
   13    29      > JMP                                                      ->70
   15    30    >   IS_EQUAL                                                 !3, 2
         31      > JMPZ                                                     ~21, ->39
   16    32    >   FETCH_DIM_R                                      ~22     !1, 0
         33        ROPE_INIT                                     3  ~25     ~22
         34        ROPE_ADD                                      1  ~25     ~25, '+and+'
         35        FETCH_DIM_R                                      ~23     !1, 1
         36        ROPE_END                                      2  ~24     ~25, ~23
         37        ECHO                                                     ~24
   15    38      > JMP                                                      ->70
   17    39    >   IS_EQUAL                                                 !3, 3
         40      > JMPZ                                                     ~27, ->51
   18    41    >   FETCH_DIM_R                                      ~28     !1, 0
         42        ROPE_INIT                                     5  ~32     ~28
         43        ROPE_ADD                                      1  ~32     ~32, '%2C+'
         44        FETCH_DIM_R                                      ~29     !1, 1
         45        ROPE_ADD                                      2  ~32     ~32, ~29
         46        ROPE_ADD                                      3  ~32     ~32, '%2C+and+'
         47        FETCH_DIM_R                                      ~30     !1, 2
         48        ROPE_END                                      4  ~31     ~32, ~30
         49        ECHO                                                     ~31
   17    50      > JMP                                                      ->70
   20    51    >   FETCH_DIM_R                                      ~35     !1, 0
         52        ROPE_INIT                                     6  ~39     ~35
         53        ROPE_ADD                                      1  ~39     ~39, '%2C+'
         54        FETCH_DIM_R                                      ~36     !1, 1
         55        ROPE_ADD                                      2  ~39     ~39, ~36
         56        ROPE_ADD                                      3  ~39     ~39, '%2C+'
         57        FETCH_DIM_R                                      ~37     !1, 2
         58        ROPE_ADD                                      4  ~39     ~39, ~37
         59        ROPE_END                                      5  ~38     ~39, '%2C+and+'
         60        ECHO                                                     ~38
         61        SUB                                              ~42     !3, 3
         62        ECHO                                                     ~42
         63        ECHO                                                     '+other'
         64        IS_NOT_EQUAL                                             !3, 4
         65      > JMPZ                                                     ~43, ->68
         66    >   QM_ASSIGN                                        ~44     's'
         67      > JMP                                                      ->69
         68    >   QM_ASSIGN                                        ~44     ''
         69    >   ECHO                                                     ~44
   22    70    >   ECHO                                                     '%0A---%0A'
    9    71      > JMP                                                      ->13
         72    >   FE_FREE                                                  $10
   23    73      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.9 ms | 1004 KiB | 13 Q