3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $old = <<<HEREDOC <?php // Connect $link = mysql_connect('mysql_host', 'mysql_user', 'mysql_password') OR die(mysql_error()); // Query $query = sprintf("SELECT * FROM users WHERE user='%s' AND password='%s'", mysql_real_escape_string($user), mysql_real_escape_string($password)); ?> HEREDOC; echo preg_replace('/mysql_([a-zA-Z_]+)\(/', 'mysqli_$1($GLOBALS[\'link\'], ');
Output for 7.0.0 - 7.1.0
Notice: Undefined variable: link in /in/LkSrL on line 6 Notice: Undefined variable: query in /in/LkSrL on line 10 Notice: Undefined variable: user in /in/LkSrL on line 11 Notice: Undefined variable: password in /in/LkSrL on line 12 Warning: preg_replace() expects at least 3 parameters, 2 given in /in/LkSrL on line 16
Output for 5.3.0 - 5.6.28
Notice: Undefined variable: link in /in/LkSrL on line 10 Notice: Undefined variable: query in /in/LkSrL on line 11 Notice: Undefined variable: user in /in/LkSrL on line 12 Notice: Undefined variable: password in /in/LkSrL on line 13 Warning: preg_replace() expects at least 3 parameters, 2 given in /in/LkSrL on line 16
Output for 5.2.3 - 5.2.17
Notice: Undefined variable: link in /in/LkSrL on line 10 Notice: Undefined variable: query in /in/LkSrL on line 11 Notice: Undefined variable: user in /in/LkSrL on line 12 Notice: Undefined variable: password in /in/LkSrL on line 13 Warning: Wrong parameter count for preg_replace() in /in/LkSrL on line 16
Output for 5.0.4 - 5.1.1, 5.1.3 - 5.2.2
Notice: Undefined variable: link in /in/LkSrL on line 6 Notice: Undefined variable: query in /in/LkSrL on line 10 Notice: Undefined variable: user in /in/LkSrL on line 12 Notice: Undefined variable: password in /in/LkSrL on line 14 Warning: Wrong parameter count for preg_replace() in /in/LkSrL on line 16
Output for 5.1.2
Notice: Undefined variable: link in /in/LkSrL on line 6 Notice: Undefined variable: query in /in/LkSrL on line 10 Notice: Undefined variable: user in /in/LkSrL on line 12 Notice: Undefined variable: password in /in/LkSrL on line 14 Warning: Wrong parameter count for preg_replace() in /in/LkSrL on line 17
Output for 4.3.0 - 4.4.1, 4.4.3 - 5.0.3
Notice: Undefined variable: link in /in/LkSrL on line 6 Notice: Undefined variable: query in /in/LkSrL on line 10 Notice: Undefined variable: user in /in/LkSrL on line 12 Notice: Undefined variable: password in /in/LkSrL on line 14 Warning: Wrong parameter count for preg_replace() in /in/LkSrL on line 16
Output for 4.4.2
Notice: Undefined variable: link in /in/LkSrL on line 6 Notice: Undefined variable: query in /in/LkSrL on line 10 Notice: Undefined variable: user in /in/LkSrL on line 12 Notice: Undefined variable: password in /in/LkSrL on line 14 Warning: Wrong parameter count for preg_replace() in /in/LkSrL on line 17