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'; }

This is an error 500

Value for `_results` contains invalid data `array`


preferences:
152.41 ms | 2179 KiB | 11 Q