3v4l.org

run code in 300+ PHP versions simultaneously
<?php $old = <<<'NOWDOC' <?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)); ?> NOWDOC; $new = preg_replace('/mysql_([a-zA-Z_]+)\(/', 'mysqli_$1($GLOBALS[\'link\'], ', $old); $new = str_replace('mysqli_connect($GLOBALS[\'link\'], ', 'mysqli_connect(', $new); $new = str_replace(', )', ')', $new); echo $new;
Output for git.master, git.master_jit, rfc.property-hooks
<?php // Connect $link = mysqli_connect('mysql_host', 'mysql_user', 'mysql_password') OR die(mysqli_error($GLOBALS['link'])); // Query $query = sprintf("SELECT * FROM users WHERE user='%s' AND password='%s'", mysqli_real_escape_string($GLOBALS['link'], $user), mysqli_real_escape_string($GLOBALS['link'], $password)); ?>

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:
25.65 ms | 406 KiB | 5 Q