3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<html> <body> <h1>1KB Forum</h1> <?php mysql_connect('localhost','username','********');mysql_select_db('d');extract($_REQUEST);$v=intval($v);$i=0;$q='mysql_query';$f='mysql_fetch_row';$n='mysql_num_rows';$x='<input type="';$s="SELECT*FROM";$t='CREATE TABLE IF NOT EXISTS t(i INT AUTO_INCREMENT,a INT,b TEXT,KEY(i))';$h='htmlspecialchars';$q($t);$q(str_replace('t','p',$t));$l=' ORDER BY';$o='';$u='INSERT INTO';$c="b)VALUES('";if($b){if(!$v)$q("$u t($c$e')");$v=max($v,mysql_insert_id());$q("$u p(a,$c$v','$b')");}if($v){$t=$q("$s p WHERE a=$v$l i");echo'<a href="f.php">Back</a>';for(;$i<$n($t);++$i){$r=$f($t);echo'<hr/>'.nl2br($h($r[2]));}}else{$t=$q("$s t$l-i");for(;$i<$n($t);++$i){$r=$f($t);echo'<a href="f.php?v='.$r[0].'">'.$h($r[2]).'</a><br/>';}$o='Title:'.$x.'text"name="e"/><br/>';}echo'<hr/>Post:<form action="f.php"method="post">'.$x.'hidden"name="v"value="'."$v\"/>$o<textarea name=\"b\"></textarea>$x";?>submit"name="w"value="Post"/></form></body></htm ?>
Output for 7.0.0 - 7.1.0
<html> <body> <h1>1KB Forum</h1> Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /in/APL3a:9 Stack trace: #0 {main} thrown in /in/APL3a on line 9
Process exited with code 255.
Output for hhvm-3.10.0 - 3.12.0
<html> <body> <h1>1KB Forum</h1> Warning: mysql_connect(): Can't connect to local MySQL server through socket '/run/mysqld/mysqld.sock' (2) in /in/APL3a on line 9 Notice: Undefined variable: v in /in/APL3a on line 9 Notice: Undefined variable: b in /in/APL3a on line 9 Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in /in/APL3a on line 9 <hr/>Post:<form action="f.php"method="post"><input type="hidden"name="v"value="0"/>Title:<input type="text"name="e"/><br/><textarea name="b"></textarea><input type="submit"name="w"value="Post"/></form></body></htm ?>
Output for 5.2.3 - 5.6.28
<html> <body> <h1>1KB Forum</h1> Fatal error: Call to undefined function mysql_connect() in /in/APL3a on line 9
Process exited with code 255.
Output for 5.0.0 - 5.2.2
<html> <body> <h1>1KB Forum</h1> <br /> <b>Fatal error</b>: Call to undefined function mysql_connect() in <b>/in/APL3a</b> on line <b>9</b><br />
Process exited with code 255.
Output for 4.4.3 - 4.4.9
<html> <body> <h1>1KB Forum</h1> <br /> <b>Warning</b>: mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in <b>/in/APL3a</b> on line <b>9</b><br /> <br /> <b>Warning</b>: mysql_select_db() [<a href='function.mysql-select-db'>function.mysql-select-db</a>]: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in <b>/in/APL3a</b> on line <b>9</b><br /> <br /> <b>Warning</b>: mysql_select_db() [<a href='function.mysql-select-db'>function.mysql-select-db</a>]: A link to the server could not be established in <b>/in/APL3a</b> on line <b>9</b><br /> <br /> <b>Warning</b>: mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in <b>/in/APL3a</b> on line <b>9</b><br /> <br /> <b>Warning</b>: mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: A link to the server could not be established in <b>/in/APL3a</b> on line <b>9</b><br /> <br /> <b>Warning</b>: mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in <b>/in/APL3a</b> on line <b>9</b><br /> <br /> <b>Warning</b>: mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: A link to the server could not be established in <b>/in/APL3a</b> on line <b>9</b><br /> <br /> <b>Warning</b>: mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in <b>/in/APL3a</b> on line <b>9</b><br /> <br /> <b>Warning</b>: mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: A link to the server could not be established in <b>/in/APL3a</b> on line <b>9</b><br /> <br /> <b>Warning</b>: mysql_num_rows(): supplied argument is not a valid MySQL result resource in <b>/in/APL3a</b> on line <b>9</b><br /> <hr/>Post:<form action="f.php"method="post"><input type="hidden"name="v"value="0"/>Title:<input type="text"name="e"/><br/><textarea name="b"></textarea><input type="submit"name="w"value="Post"/></form></body></htm ?>
Output for 4.3.2 - 4.4.2
<html> <body> <h1>1KB Forum</h1> <br /> <b>Warning</b>: mysql_connect(): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in <b>/in/APL3a</b> on line <b>9</b><br /> <br /> <b>Warning</b>: mysql_select_db(): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in <b>/in/APL3a</b> on line <b>9</b><br /> <br /> <b>Warning</b>: mysql_select_db(): A link to the server could not be established in <b>/in/APL3a</b> on line <b>9</b><br /> <br /> <b>Warning</b>: mysql_query(): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in <b>/in/APL3a</b> on line <b>9</b><br /> <br /> <b>Warning</b>: mysql_query(): A link to the server could not be established in <b>/in/APL3a</b> on line <b>9</b><br /> <br /> <b>Warning</b>: mysql_query(): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in <b>/in/APL3a</b> on line <b>9</b><br /> <br /> <b>Warning</b>: mysql_query(): A link to the server could not be established in <b>/in/APL3a</b> on line <b>9</b><br /> <br /> <b>Warning</b>: mysql_query(): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in <b>/in/APL3a</b> on line <b>9</b><br /> <br /> <b>Warning</b>: mysql_query(): A link to the server could not be established in <b>/in/APL3a</b> on line <b>9</b><br /> <br /> <b>Warning</b>: mysql_num_rows(): supplied argument is not a valid MySQL result resource in <b>/in/APL3a</b> on line <b>9</b><br /> <hr/>Post:<form action="f.php"method="post"><input type="hidden"name="v"value="0"/>Title:<input type="text"name="e"/><br/><textarea name="b"></textarea><input type="submit"name="w"value="Post"/></form></body></htm ?>
Output for 4.3.0 - 4.3.1
<html> <body> <h1>1KB Forum</h1> <br /> <b>Warning</b>: mysql_connect() [<a href='http://www.php.net/function.mysql-connect'>function.mysql-connect</a>]: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in <b>/in/APL3a</b> on line <b>9</b><br /> <br /> <b>Warning</b>: mysql_select_db() [<a href='http://www.php.net/function.mysql-select-db'>function.mysql-select-db</a>]: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in <b>/in/APL3a</b> on line <b>9</b><br /> <br /> <b>Warning</b>: mysql_select_db() [<a href='http://www.php.net/function.mysql-select-db'>function.mysql-select-db</a>]: A link to the server could not be established in <b>/in/APL3a</b> on line <b>9</b><br /> <br /> <b>Warning</b>: mysql_query() [<a href='http://www.php.net/function.mysql-query'>function.mysql-query</a>]: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in <b>/in/APL3a</b> on line <b>9</b><br /> <br /> <b>Warning</b>: mysql_query() [<a href='http://www.php.net/function.mysql-query'>function.mysql-query</a>]: A link to the server could not be established in <b>/in/APL3a</b> on line <b>9</b><br /> <br /> <b>Warning</b>: mysql_query() [<a href='http://www.php.net/function.mysql-query'>function.mysql-query</a>]: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in <b>/in/APL3a</b> on line <b>9</b><br /> <br /> <b>Warning</b>: mysql_query() [<a href='http://www.php.net/function.mysql-query'>function.mysql-query</a>]: A link to the server could not be established in <b>/in/APL3a</b> on line <b>9</b><br /> <br /> <b>Warning</b>: mysql_query() [<a href='http://www.php.net/function.mysql-query'>function.mysql-query</a>]: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in <b>/in/APL3a</b> on line <b>9</b><br /> <br /> <b>Warning</b>: mysql_query() [<a href='http://www.php.net/function.mysql-query'>function.mysql-query</a>]: A link to the server could not be established in <b>/in/APL3a</b> on line <b>9</b><br /> <br /> <b>Warning</b>: mysql_num_rows(): supplied argument is not a valid MySQL result resource in <b>/in/APL3a</b> on line <b>9</b><br /> <hr/>Post:<form action="f.php"method="post"><input type="hidden"name="v"value="0"/>Title:<input type="text"name="e"/><br/><textarea name="b"></textarea><input type="submit"name="w"value="Post"/></form></body></htm ?>