3v4l.org

run code in 500+ PHP versions simultaneously
<?php $allowed = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'; $input = 'abc-def'; $validLen = strspn($input, $allowed); if (strlen($input) !== $validLen) { printf('Input invalid, starting at %s', substr($input, $validLen)); } else { echo 'Input is valid'; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 16
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gdZJ4
function name:  (null)
number of ops:  18
compiled vars:  !0 = $allowed, !1 = $input, !2 = $validLen
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'
    4     1        ASSIGN                                                       !1, 'abc-def'
    6     2        INIT_FCALL                                                   'strspn'
          3        SEND_VAR                                                     !1
          4        SEND_VAR                                                     !0
          5        DO_ICALL                                             $5      
          6        ASSIGN                                                       !2, $5
    7     7        STRLEN                                               ~7      !1
          8        IS_NOT_IDENTICAL                                             !2, ~7
          9      > JMPZ                                                         ~8, ->16
    8    10    >   INIT_FCALL                                                   'printf'
         11        SEND_VAL                                                     'Input+invalid%2C+starting+at+%25s'
         12        FRAMELESS_ICALL_2                substr              ~9      !1, !2
         13        SEND_VAL                                                     ~9
         14        DO_ICALL                                                     
    7    15      > JMP                                                          ->17
   10    16    >   ECHO                                                         'Input+is+valid'
   11    17    > > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
165.63 ms | 2167 KiB | 15 Q