3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php preg_match('/^[\w\.]+$/', 'admin.general.canViewPrivateUserOptions', $matches); var_dump($matches); preg_match('/^[\w-\.]+$/', 'admin.general.canViewPrivateUserOptions', $matches); var_dump($matches); preg_match('/^[\\w-\\.]+$/', 'admin.general.canViewPrivateUserOptions', $matches); var_dump($matches);
Output for 7.3.0alpha1 - 7.3.0beta1
array(1) { [0]=> string(39) "admin.general.canViewPrivateUserOptions" } Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /in/66NDo on line 6 array(1) { [0]=> string(39) "admin.general.canViewPrivateUserOptions" } Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /in/66NDo on line 9 array(1) { [0]=> string(39) "admin.general.canViewPrivateUserOptions" }
Output for 5.6.30, hhvm-3.18.5 - 3.22.0, 7.0.30 - 7.2.11
array(1) { [0]=> string(39) "admin.general.canViewPrivateUserOptions" } array(1) { [0]=> string(39) "admin.general.canViewPrivateUserOptions" } array(1) { [0]=> string(39) "admin.general.canViewPrivateUserOptions" }