3v4l.org

run code in 300+ PHP versions simultaneously
<?php $requiredFields = ['name', 'age', 'hair_colour']; // Note: $errorArray is not initialised foreach ( $requiredFields as $field ) { if ( ! isset($_POST[$field]) ) { $errorArray[] = "Missing required field '$field'. "; } } echo implode('', $errorArray);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 13
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 13
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 12
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 12
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
filename:       /in/ojZ1O
function name:  (null)
number of ops:  20
compiled vars:  !0 = $requiredFields, !1 = $field, !2 = $errorArray
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    6     1      > FE_RESET_R                                       $4      !0, ->13
          2    > > FE_FETCH_R                                               $4, !1, ->13
    7     3    >   FETCH_IS                                         ~5      '_POST'
          4        ISSET_ISEMPTY_DIM_OBJ                         0  ~6      ~5, !1
          5        BOOL_NOT                                         ~7      ~6
          6      > JMPZ                                                     ~7, ->12
    8     7    >   ROPE_INIT                                     3  ~10     'Missing+required+field+%27'
          8        ROPE_ADD                                      1  ~10     ~10, !1
          9        ROPE_END                                      2  ~9      ~10, '%27.+'
         10        ASSIGN_DIM                                               !2
         11        OP_DATA                                                  ~9
    6    12    > > JMP                                                      ->2
         13    >   FE_FREE                                                  $4
   11    14        INIT_FCALL                                               'implode'
         15        SEND_VAL                                                 ''
         16        SEND_VAR                                                 !2
         17        DO_ICALL                                         $12     
         18        ECHO                                                     $12
         19      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.57 ms | 1395 KiB | 15 Q