3v4l.org

run code in 300+ PHP versions simultaneously
<?php $strings = [ 'my_name_is_John_Doe', 'my_name_is john doe', 'my_name_is_john_doe', 'i_am_20_years_old', "i'm_cool!" ]; foreach ($strings as $string) { echo json_encode([ $string, !strlen(ltrim($string, 'a..z_')), !preg_match('/[a-z_]*[^a-z_]/', $string) ]); echo "\n\n"; }

preferences:
55.59 ms | 406 KiB | 5 Q