3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = <<<TEXT rkenbgjengrnekjrgn2ioih34fnorfejk TEXT; $char = array_merge(range("a", "z"), range("A", "Z")); $length = strlen($text); $counter = array(); for($i = 0; $i < $length; $i++) { $item = $text[$i]; if (in_array($item, $char)) { $counter[$item] = isset($counter[$item]) ? $counter[$item] + 1 : 1; } } arsort($counter); var_dump($counter);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 36
Branch analysis from position: 36
2 jumps found. (Code = 44) Position 1 = 38, Position 2 = 19
Branch analysis from position: 38
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
2 jumps found. (Code = 43) Position 1 = 26, Position 2 = 35
Branch analysis from position: 26
2 jumps found. (Code = 43) Position 1 = 28, Position 2 = 32
Branch analysis from position: 28
1 jumps found. (Code = 42) Position 1 = 33
Branch analysis from position: 33
2 jumps found. (Code = 44) Position 1 = 38, Position 2 = 19
Branch analysis from position: 38
Branch analysis from position: 19
Branch analysis from position: 32
2 jumps found. (Code = 44) Position 1 = 38, Position 2 = 19
Branch analysis from position: 38
Branch analysis from position: 19
Branch analysis from position: 35
filename:       /in/4ZA26
function name:  (null)
number of ops:  45
compiled vars:  !0 = $text, !1 = $char, !2 = $length, !3 = $counter, !4 = $i, !5 = $item
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'rkenbgjengrnekjrgn2ioih34fnorfejk'
    7     1        INIT_FCALL                                               'array_merge'
          2        INIT_FCALL                                               'range'
          3        SEND_VAL                                                 'a'
          4        SEND_VAL                                                 'z'
          5        DO_ICALL                                         $7      
          6        SEND_VAR                                                 $7
          7        INIT_FCALL                                               'range'
          8        SEND_VAL                                                 'A'
          9        SEND_VAL                                                 'Z'
         10        DO_ICALL                                         $8      
         11        SEND_VAR                                                 $8
         12        DO_ICALL                                         $9      
         13        ASSIGN                                                   !1, $9
    9    14        STRLEN                                           ~11     !0
         15        ASSIGN                                                   !2, ~11
   11    16        ASSIGN                                                   !3, <array>
   13    17        ASSIGN                                                   !4, 0
         18      > JMP                                                      ->36
   15    19    >   FETCH_DIM_R                                      ~15     !0, !4
         20        ASSIGN                                                   !5, ~15
   17    21        INIT_FCALL                                               'in_array'
         22        SEND_VAR                                                 !5
         23        SEND_VAR                                                 !1
         24        DO_ICALL                                         $17     
         25      > JMPZ                                                     $17, ->35
   18    26    >   ISSET_ISEMPTY_DIM_OBJ                         0          !3, !5
         27      > JMPZ                                                     ~19, ->32
         28    >   FETCH_DIM_R                                      ~20     !3, !5
         29        ADD                                              ~21     ~20, 1
         30        QM_ASSIGN                                        ~22     ~21
         31      > JMP                                                      ->33
         32    >   QM_ASSIGN                                        ~22     1
         33    >   ASSIGN_DIM                                               !3, !5
         34        OP_DATA                                                  ~22
   13    35    >   PRE_INC                                                  !4
         36    >   IS_SMALLER                                               !4, !2
         37      > JMPNZ                                                    ~24, ->19
   22    38    >   INIT_FCALL                                               'arsort'
         39        SEND_REF                                                 !3
         40        DO_ICALL                                                 
   24    41        INIT_FCALL                                               'var_dump'
         42        SEND_VAR                                                 !3
         43        DO_ICALL                                                 
         44      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.18 ms | 1392 KiB | 23 Q