3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $str_utf8 = 'qqРусскийqqтекст12'; $login = $login;//iconv('UTF-8', 'Windows-1251', $str_utf8); $password = $password; //iconv('UTF-8', 'Windows-1251', $str_utf8); if (preg_match('#.#u', $login)) { $login = iconv('UTF-8', 'CP1251', $login); } if (preg_match('#.#u', $password)) { $password = iconv('UTF-8', 'CP1251', $password); } var_dump($login); var_dump($password);
Output for 5.0.4 - 7.1.0
Notice: Undefined variable: login in /in/0vrKt on line 3 Notice: Undefined variable: password in /in/0vrKt on line 4 NULL NULL
Output for 4.3.0 - 5.0.3
Notice: Undefined variable: login in /in/0vrKt on line 3 Notice: Undefined variable: password in /in/0vrKt on line 4 NULL NULL