3v4l.org

run code in 300+ 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 = 19
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gdZJ4
function name:  (null)
number of ops:  21
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, ->19
    8    10    >   INIT_FCALL                                               'printf'
         11        SEND_VAL                                                 'Input+invalid%2C+starting+at+%25s'
         12        INIT_FCALL                                               'substr'
         13        SEND_VAR                                                 !1
         14        SEND_VAR                                                 !2
         15        DO_ICALL                                         $9      
         16        SEND_VAR                                                 $9
         17        DO_ICALL                                                 
    7    18      > JMP                                                      ->20
   10    19    >   ECHO                                                     'Input+is+valid'
   11    20    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.65 ms | 1012 KiB | 16 Q