3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $host= '185.30.146.120'; $username = 'arenssql1'; $pwd= 'Arensi'; $db='arenssql1'; $con=mysqli_connect($host,$username,$pwd,$db) or die('Unable to connect'); if(mysqli_connect_error($con)) { echo "Failed to connect"; } $query=mysqli_query($con, "SELECT * FROM news"); if($query) { while($row-mysqli_fetch_array($query)) { $flag[] =$row; } print(json_encode($flag)); } mysqli_close(con); ?>
based on BS48c
Output for 7.0.0 - 7.3.0beta1
Fatal error: Uncaught Error: Call to undefined function mysqli_connect() in /in/LTOEO:8 Stack trace: #0 {main} thrown in /in/LTOEO on line 8
Process exited with code 255.
Output for hhvm-3.22.0
Warning: mysql_connect(): Can't connect to MySQL server on '185.30.146.120' (101) in /in/LTOEO on line -1 Unable to connect
Output for hhvm-3.21.3
Warning: mysql_connect(): Can't connect to MySQL server on '185.30.146.120' (101) in /in/LTOEO on line 8 Unable to connect
Output for hhvm-3.18.5
Warning: mysql_connect(): Can't connect to MySQL server on '185.30.146.120' (101) Unable to connect
Output for 5.6.0 - 5.6.30
Fatal error: Call to undefined function mysqli_connect() in /in/LTOEO on line 8
Process exited with code 255.