3v4l.org

run code in 500+ PHP versions simultaneously
<?php $scores = [45, '23', 1]; $scores_string = ''; $len = count($scores); for ($i = 0; $i < $len; $i++) { if (empty($scores[$i]) || !is_numeric($scores[$i])) { $scores_string = 'You must enter three valid numbers for scores.'; break; } } if ($scores_string != '') { echo $scores_string; // do anything else you need } else { // all is OK! }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 6
Branch analysis from position: 18
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 22
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
Branch analysis from position: 6
2 jumps found. (Code = 47) Position 1 = 8, Position 2 = 12
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 15
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
Branch analysis from position: 15
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 6
Branch analysis from position: 18
Branch analysis from position: 6
Branch analysis from position: 12
filename:       /in/ZDtND
function name:  (null)
number of ops:  23
compiled vars:  !0 = $scores, !1 = $scores_string, !2 = $len, !3 = $i
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
    4     1        ASSIGN                                                       !1, ''
    5     2        COUNT                                                ~6      !0
          3        ASSIGN                                                       !2, ~6
    6     4        ASSIGN                                                       !3, 0
          5      > JMP                                                          ->16
    7     6    >   ISSET_ISEMPTY_DIM_OBJ                             1  ~9      !0, !3
          7      > JMPNZ_EX                                             ~9      ~9, ->12
          8    >   FETCH_DIM_R                                          ~10     !0, !3
          9        FRAMELESS_ICALL_1                is_numeric          ~11     ~10
         10        BOOL_NOT                                             ~12     ~11
         11        BOOL                                                 ~9      ~12
         12    > > JMPZ                                                         ~9, ->15
    8    13    >   ASSIGN                                                       !1, 'You+must+enter+three+valid+numbers+for+scores.'
    9    14      > JMP                                                          ->18
    6    15    >   PRE_INC                                                      !3
         16    >   IS_SMALLER                                                   !3, !2
         17      > JMPNZ                                                        ~15, ->6
   12    18    >   IS_NOT_EQUAL                                                 !1, ''
         19      > JMPZ                                                         ~16, ->22
   13    20    >   ECHO                                                         !1
   12    21      > JMP                                                          ->22
   18    22    > > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
166.6 ms | 1927 KiB | 13 Q