3v4l.org

run code in 300+ PHP versions simultaneously
<?php $messages = [ 'Fout in veld 1', 'Fout in veld 2', 'Fouten in veld 3' => [ 'titel', 'is niet uniek', 'moet minimaal 3 tekens lang zijn', ], 'Fout in veld 6' ]; function rec($messages, $i = 0) { foreach($messages as $title => $message) { if (is_array($message)) { $k = $i + 1; return rec($message, $k); } $output = ''; for ($j = -1; $j < $i; $j++) { $output .= ' - '; } echo $output . $message + "\n"; } } rec($messages);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vOv2h
function name:  (null)
number of ops:  5
compiled vars:  !0 = $messages
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   37     1        INIT_FCALL                                               'rec'
          2        SEND_VAR                                                 !0
          3        DO_FCALL                                      0          
          4      > RETURN                                                   1

Function rec:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 26
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 26
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 15
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
2 jumps found. (Code = 44) Position 1 = 22, Position 2 = 18
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 18
2 jumps found. (Code = 44) Position 1 = 22, Position 2 = 18
Branch analysis from position: 22
Branch analysis from position: 18
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 26
filename:       /in/vOv2h
function name:  rec
number of ops:  28
compiled vars:  !0 = $messages, !1 = $i, !2 = $message, !3 = $title, !4 = $k, !5 = $output, !6 = $j
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      0
   16     2      > FE_RESET_R                                       $7      !0, ->26
          3    > > FE_FETCH_R                                       ~8      $7, !2, ->26
          4    >   ASSIGN                                                   !3, ~8
   18     5        TYPE_CHECK                                  128          !2
          6      > JMPZ                                                     ~10, ->15
   20     7    >   ADD                                              ~11     !1, 1
          8        ASSIGN                                                   !4, ~11
   21     9        INIT_FCALL_BY_NAME                                       'rec'
         10        SEND_VAR_EX                                              !2
         11        SEND_VAR_EX                                              !4
         12        DO_FCALL                                      0  $13     
         13        FE_FREE                                                  $7
         14      > RETURN                                                   $13
   24    15    >   ASSIGN                                                   !5, ''
   26    16        ASSIGN                                                   !6, -1
         17      > JMP                                                      ->20
   28    18    >   ASSIGN_OP                                     8          !5, '+-+'
   26    19        PRE_INC                                                  !6
         20    >   IS_SMALLER                                               !6, !1
         21      > JMPNZ                                                    ~18, ->18
   31    22    >   ADD                                              ~19     !2, '%0A'
         23        CONCAT                                           ~20     !5, ~19
         24        ECHO                                                     ~20
   16    25      > JMP                                                      ->3
         26    >   FE_FREE                                                  $7
   34    27      > RETURN                                                   null

End of function rec

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.47 ms | 1402 KiB | 14 Q