3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php error_reporting(-1); echo "HELLO"; $x = mysql_connect("localhost","peneder","peneder") or die("LOL"); var_dump("BYE"); $sql = new mysqli("localhost:3306", "peneder", "peneder", "peneder"); echo "ASH"; if($sql->connect_errno > 0) echo("SQL ERROR"); $q = $sql->query("SELECT `peneder` FROM `peneder`.`peneder`"); if(!$q) echo("QUERY ERROR"); $PENEDER = []; while($row = $q->fetch_assoc()) array_push($PENEDER[],$row["peneder"]); echo $PENEDER[rand(0,count($PENEDER)-1)]; $q->free(); $sql->close();
Output for 7.0.0 - 7.1.0
HELLO Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /in/OFX6e:5 Stack trace: #0 {main} thrown in /in/OFX6e on line 5
Process exited with code 255.
Output for hhvm-3.10.0 - 3.12.0
HELLO Warning: mysql_connect(): Can't connect to local MySQL server through socket '/run/mysqld/mysqld.sock' (2) in /in/OFX6e on line 5 LOL
Output for 5.4.0 - 5.6.28
HELLO Fatal error: Call to undefined function mysql_connect() in /in/OFX6e on line 5
Process exited with code 255.
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/OFX6e on line 12
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected '[' in /in/OFX6e on line 12
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/OFX6e on line 12
Process exited with code 255.