3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "B1A23R4CD"; $chars = str_split($string); $output = [[], []]; foreach ($chars as $char) { $output[ctype_alpha($char)][] = $char; // ^^^^^^^^^^^^^^^^^^- false is 0, true is 1 } var_export($output);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 15
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 15
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/mRisu
function name:  (null)
number of ops:  20
compiled vars:  !0 = $string, !1 = $chars, !2 = $output, !3 = $char
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'B1A23R4CD'
    3     1        INIT_FCALL                                               'str_split'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $5      
          4        ASSIGN                                                   !1, $5
    4     5        ASSIGN                                                   !2, <array>
    5     6      > FE_RESET_R                                       $8      !1, ->15
          7    > > FE_FETCH_R                                               $8, !3, ->15
    6     8    >   INIT_FCALL                                               'ctype_alpha'
          9        SEND_VAR                                                 !3
         10        DO_ICALL                                         $9      
         11        FETCH_DIM_W                                      $10     !2, $9
         12        ASSIGN_DIM                                               $10
         13        OP_DATA                                                  !3
    5    14      > JMP                                                      ->7
         15    >   FE_FREE                                                  $8
   10    16        INIT_FCALL                                               'var_export'
         17        SEND_VAR                                                 !2
         18        DO_ICALL                                                 
         19      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.53 ms | 999 KiB | 16 Q