3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ "Aulas Gratuitas", "149", "151", "153", "Módulo 0", "964", "989", "967", "978", "Módulo 1", "985", "1079", "1001", "1003", "1005", "Módulo 2", ]; $result = []; foreach ($array as $value) { if (!ctype_digit($value)) { unset($units); $units = []; $result[] = ['title' => $value, 'units' => &$units]; } else { $units[] = $value; } } var_export($result);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 19
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 19
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 16
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/n683N
function name:  (null)
number of ops:  24
compiled vars:  !0 = $array, !1 = $result, !2 = $value, !3 = $units
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   22     1        ASSIGN                                                   !1, <array>
   23     2      > FE_RESET_R                                       $6      !0, ->19
          3    > > FE_FETCH_R                                               $6, !2, ->19
   24     4    >   INIT_FCALL                                               'ctype_digit'
          5        SEND_VAR                                                 !2
          6        DO_ICALL                                         $7      
          7        BOOL_NOT                                         ~8      $7
          8      > JMPZ                                                     ~8, ->16
   25     9    >   UNSET_CV                                                 !3
   26    10        ASSIGN                                                   !3, <array>
   27    11        INIT_ARRAY                                       ~11     !2, 'title'
         12        ADD_ARRAY_ELEMENT                                ~11     !3, 'units'
         13        ASSIGN_DIM                                               !1
         14        OP_DATA                                                  ~11
   24    15      > JMP                                                      ->18
   29    16    >   ASSIGN_DIM                                               !3
         17        OP_DATA                                                  !2
   23    18    > > JMP                                                      ->3
         19    >   FE_FREE                                                  $6
   32    20        INIT_FCALL                                               'var_export'
         21        SEND_VAR                                                 !1
         22        DO_ICALL                                                 
         23      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.62 ms | 1003 KiB | 15 Q