3v4l.org

run code in 300+ PHP versions simultaneously
<?php $link = mysqli_connect("127.0.0.1", "my_user", "my_password", "my_db"); if (!$link) { echo "Error: Unable to connect to MySQL." . PHP_EOL; echo "Debugging errno: " . mysqli_connect_errno() . PHP_EOL; echo "Debugging error: " . mysqli_connect_error() . PHP_EOL; exit; } echo "Success: A proper connection to MySQL was made! The my_db database is great." . PHP_EOL; echo "Host information: " . mysqli_get_host_info($link) . PHP_EOL; mysqli_close($link); ?>
Output for 7.0.0 - 7.0.27, 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.16 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
Fatal error: Uncaught Error: Call to undefined function mysqli_connect() in /in/GF3uY:2 Stack trace: #0 {main} thrown in /in/GF3uY on line 2
Process exited with code 255.
Output for 5.5.0 - 5.5.38, 5.6.0 - 5.6.30
Fatal error: Call to undefined function mysqli_connect() in /in/GF3uY on line 2
Process exited with code 255.

preferences:
180.79 ms | 401 KiB | 253 Q