3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function foo() { var_dump(preg_match_all('/\\w+/u', "-foo-barлолbaz-", $m), $m); } foo(); var_dump(setlocale(LC_COLLATE, 'ru_RU.UTF-8', 'ru_RU', 'ru')); foo();
based on I3bdD
Output for 5.3.4 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
int(2) array(1) { [0]=> array(2) { [0]=> string(3) "foo" [1]=> string(12) "barлолbaz" } } bool(false) int(2) array(1) { [0]=> array(2) { [0]=> string(3) "foo" [1]=> string(12) "barлолbaz" } }
Output for 4.3.0 - 5.3.3
int(3) array(1) { [0]=> array(3) { [0]=> string(3) "foo" [1]=> string(3) "bar" [2]=> string(3) "baz" } } bool(false) int(3) array(1) { [0]=> array(3) { [0]=> string(3) "foo" [1]=> string(3) "bar" [2]=> string(3) "baz" } }