3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $text = <<<TXT /some text/ TXT; $pattern = "/тест"; $pattern = mb_convert_encoding($pattern, 'UTF-8', 'CP1251'); $pattern = preg_quote($pattern, '/'); var_dump($pattern); $matches = array(); $match = preg_match_all("/" . $pattern . "/mi", $text, $matches); var_dump($match, $matches);
Output for 4.3.4 - 7.1.0
string(20) "\/тест" int(0) array(1) { [0]=> array(0) { } }
Output for 4.3.2 - 4.3.3
Warning: mb_convert_encoding(): Illegal character encoding specified in /in/h4T1v on line 10 string(18) "\/тест" int(0) array(1) { [0]=> array(0) { } }
Output for 4.3.0 - 4.3.1
Warning: mb_convert_encoding() [http://www.php.net/function.mb-convert-encoding]: Illegal character encoding specified in /in/h4T1v on line 10 string(18) "\/тест" int(0) array(1) { [0]=> array(0) { } }