3v4l.org

run code in 300+ PHP versions simultaneously
<?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 git.master, git.master_jit, rfc.property-hooks
Warning: Undefined variable $link in /in/LkSrL on line 6 Warning: Undefined variable $query in /in/LkSrL on line 10 Warning: Undefined variable $user in /in/LkSrL on line 11 Warning: Undefined variable $password in /in/LkSrL on line 12 Fatal error: Uncaught ArgumentCountError: preg_replace() expects at least 3 arguments, 2 given in /in/LkSrL:16 Stack trace: #0 /in/LkSrL(16): preg_replace('/mysql_([a-zA-Z...', 'mysqli_$1($GLOB...') #1 {main} thrown in /in/LkSrL on line 16
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
47.57 ms | 401 KiB | 8 Q