3v4l.org

run code in 300+ PHP versions simultaneously
<?php $aTest = array('apple', 'pineapple', 'banana', 'kiwi', 'pear', 'strawberry', '1234', '#qwerty'); $range = range('A','Z'); $output = array(); foreach($range AS $letters){ foreach($aTest AS $fruit){ if(ucfirst($fruit[0]) == $letters){ $output[$letters][] = ucfirst($fruit); } } } foreach($output AS $letter => $fruits){ echo $letter . "<br/>--------<br/>\n"; sort($fruits); foreach($fruits AS $indFruit){ echo $indFruit . "<br/>\n"; } echo "<br/>\n"; } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 26
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 26
Branch analysis from position: 9
2 jumps found. (Code = 77) Position 1 = 10, Position 2 = 24
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 24
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 23
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 23
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 24
Branch analysis from position: 26
2 jumps found. (Code = 77) Position 1 = 28, Position 2 = 43
Branch analysis from position: 28
2 jumps found. (Code = 78) Position 1 = 29, Position 2 = 43
Branch analysis from position: 29
2 jumps found. (Code = 77) Position 1 = 36, Position 2 = 40
Branch analysis from position: 36
2 jumps found. (Code = 78) Position 1 = 37, Position 2 = 40
Branch analysis from position: 37
1 jumps found. (Code = 42) Position 1 = 36
Branch analysis from position: 36
Branch analysis from position: 40
1 jumps found. (Code = 42) Position 1 = 28
Branch analysis from position: 28
Branch analysis from position: 40
Branch analysis from position: 43
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 43
Branch analysis from position: 26
filename:       /in/DsC8u
function name:  (null)
number of ops:  45
compiled vars:  !0 = $aTest, !1 = $range, !2 = $output, !3 = $letters, !4 = $fruit, !5 = $fruits, !6 = $letter, !7 = $indFruit
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    4     1        INIT_FCALL                                               'range'
          2        SEND_VAL                                                 'A'
          3        SEND_VAL                                                 'Z'
          4        DO_ICALL                                         $9      
          5        ASSIGN                                                   !1, $9
    6     6        ASSIGN                                                   !2, <array>
    8     7      > FE_RESET_R                                       $12     !1, ->26
          8    > > FE_FETCH_R                                               $12, !3, ->26
    9     9    > > FE_RESET_R                                       $13     !0, ->24
         10    > > FE_FETCH_R                                               $13, !4, ->24
   10    11    >   INIT_FCALL                                               'ucfirst'
         12        FETCH_DIM_R                                      ~14     !4, 0
         13        SEND_VAL                                                 ~14
         14        DO_ICALL                                         $15     
         15        IS_EQUAL                                                 !3, $15
         16      > JMPZ                                                     ~16, ->23
   11    17    >   INIT_FCALL                                               'ucfirst'
         18        SEND_VAR                                                 !4
         19        DO_ICALL                                         $19     
         20        FETCH_DIM_W                                      $17     !2, !3
         21        ASSIGN_DIM                                               $17
         22        OP_DATA                                                  $19
    9    23    > > JMP                                                      ->10
         24    >   FE_FREE                                                  $13
    8    25      > JMP                                                      ->8
         26    >   FE_FREE                                                  $12
   16    27      > FE_RESET_R                                       $20     !2, ->43
         28    > > FE_FETCH_R                                       ~21     $20, !5, ->43
         29    >   ASSIGN                                                   !6, ~21
   17    30        CONCAT                                           ~23     !6, '%3Cbr%2F%3E--------%3Cbr%2F%3E%0A'
         31        ECHO                                                     ~23
   18    32        INIT_FCALL                                               'sort'
         33        SEND_REF                                                 !5
         34        DO_ICALL                                                 
   19    35      > FE_RESET_R                                       $25     !5, ->40
         36    > > FE_FETCH_R                                               $25, !7, ->40
   20    37    >   CONCAT                                           ~26     !7, '%3Cbr%2F%3E%0A'
         38        ECHO                                                     ~26
   19    39      > JMP                                                      ->36
         40    >   FE_FREE                                                  $25
   22    41        ECHO                                                     '%3Cbr%2F%3E%0A'
   16    42      > JMP                                                      ->28
         43    >   FE_FREE                                                  $20
   24    44      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.53 ms | 1400 KiB | 19 Q